Permalink
Browse files

UI: Add some missing overrides.

  • Loading branch information...
unknownbrackets committed Jun 7, 2017
1 parent a6f5676 commit e24216e55b1ef2bb0d94efdcbb480bce589bc094
Showing with 9 additions and 13 deletions.
  1. +9 −13 UI/TouchControlLayoutScreen.cpp
@@ -48,7 +48,7 @@ class DragDropButton : public MultiTouchButton {
scale_ = theScale_;
}
virtual bool IsDown() {
bool IsDown() override {
// Don't want the button to enlarge and throw the user's perspective
// of button size off whack.
return false;
@@ -118,7 +118,7 @@ class PSPActionButtons : public DragDropButton {
squareVisible_ = visible;
}
void Draw(UIContext &dc) {
void Draw(UIContext &dc) override {
float opacity = g_Config.iTouchButtonOpacity / 100.0f;
uint32_t colorBg = colorAlpha(GetButtonColor(), opacity);
@@ -151,19 +151,15 @@ class PSPActionButtons : public DragDropButton {
}
};
void GetContentDimensions(const UIContext &dc, float &w, float &h) const{
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override {
const AtlasImage &image = dc.Draw()->GetAtlas()->images[roundId_];
w = (2 * baseActionButtonSpacing * spacing_) + image.w * scale_;
h = (2 * baseActionButtonSpacing * spacing_) + image.h * scale_;
}
virtual float GetSpacing() const { return spacing_; }
virtual void SetSpacing(float s) { spacing_ = s; }
virtual void SavePosition() {
DragDropButton::SavePosition();
}
float GetSpacing() const override { return spacing_; }
void SetSpacing(float s) override { spacing_ = s; }
private:
bool circleVisible_, crossVisible_, triangleVisible_, squareVisible_;
@@ -180,7 +176,7 @@ class PSPDPadButtons : public DragDropButton {
: DragDropButton(x, y, -1, -1, scale), spacing_(spacing) {
}
void Draw(UIContext &dc) {
void Draw(UIContext &dc) override {
float opacity = g_Config.iTouchButtonOpacity / 100.0f;
uint32_t colorBg = colorAlpha(GetButtonColor(), opacity);
@@ -204,14 +200,14 @@ class PSPDPadButtons : public DragDropButton {
}
}
void GetContentDimensions(const UIContext &dc, float &w, float &h) const{
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override {
const AtlasImage &image = dc.Draw()->GetAtlas()->images[I_DIR];
w = 2 * D_pad_Radius * spacing_ + image.w * scale_;
h = 2 * D_pad_Radius * spacing_ + image.h * scale_;
};
float GetSpacing() const { return spacing_; }
virtual void SetSpacing(float s) { spacing_ = s; }
float GetSpacing() const override { return spacing_; }
void SetSpacing(float s) override { spacing_ = s; }
private:
float &spacing_;

0 comments on commit e24216e

Please sign in to comment.