mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Remove touch() return values from screen hierarchy
This commit is contained in:
parent
fdfc4cbe40
commit
a3a949f5e6
10 changed files with 18 additions and 28 deletions
|
@ -75,20 +75,18 @@ void ScreenManager::switchToNext() {
|
|||
nextStack_.clear();
|
||||
}
|
||||
|
||||
bool ScreenManager::touch(const TouchInput &touch) {
|
||||
void ScreenManager::touch(const TouchInput &touch) {
|
||||
std::lock_guard<std::recursive_mutex> guard(inputLock_);
|
||||
bool result = false;
|
||||
// Send release all events to every screen layer.
|
||||
if (touch.flags & TOUCH_RELEASE_ALL) {
|
||||
for (auto &layer : stack_) {
|
||||
Screen *screen = layer.screen;
|
||||
result = layer.screen->touch(screen->transformTouch(touch));
|
||||
layer.screen->touch(screen->transformTouch(touch));
|
||||
}
|
||||
} else if (!stack_.empty()) {
|
||||
Screen *screen = stack_.back().screen;
|
||||
result = stack_.back().screen->touch(screen->transformTouch(touch));
|
||||
stack_.back().screen->touch(screen->transformTouch(touch));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ScreenManager::key(const KeyInput &key) {
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
virtual void postRender() {}
|
||||
virtual void resized() {}
|
||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) {}
|
||||
virtual bool touch(const TouchInput &touch) { return false; }
|
||||
virtual void touch(const TouchInput &touch) {}
|
||||
virtual bool key(const KeyInput &key) { return false; }
|
||||
virtual bool axis(const AxisInput &touch) { return false; }
|
||||
virtual void sendMessage(const char *msg, const char *value) {}
|
||||
|
@ -132,7 +132,7 @@ public:
|
|||
Screen *dialogParent(const Screen *dialog) const;
|
||||
|
||||
// Instant touch, separate from the update() mechanism.
|
||||
bool touch(const TouchInput &touch);
|
||||
void touch(const TouchInput &touch);
|
||||
bool key(const KeyInput &key);
|
||||
bool axis(const AxisInput &touch);
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ TouchInput UIScreen::transformTouch(const TouchInput &touch) {
|
|||
return updated;
|
||||
}
|
||||
|
||||
bool UIScreen::touch(const TouchInput &touch) {
|
||||
void UIScreen::touch(const TouchInput &touch) {
|
||||
if (root_) {
|
||||
if (ClickDebug && (touch.flags & TOUCH_DOWN)) {
|
||||
INFO_LOG(SYSTEM, "Touch down!");
|
||||
|
@ -163,9 +163,7 @@ bool UIScreen::touch(const TouchInput &touch) {
|
|||
}
|
||||
|
||||
UI::TouchEvent(touch, root_);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIScreen::key(const KeyInput &key) {
|
||||
|
@ -235,16 +233,16 @@ PopupScreen::PopupScreen(std::string title, std::string button1, std::string but
|
|||
alpha_ = 0.0f;
|
||||
}
|
||||
|
||||
bool PopupScreen::touch(const TouchInput &touch) {
|
||||
void PopupScreen::touch(const TouchInput &touch) {
|
||||
if (!box_ || (touch.flags & TOUCH_DOWN) == 0) {
|
||||
return UIDialogScreen::touch(touch);
|
||||
UIDialogScreen::touch(touch);
|
||||
}
|
||||
|
||||
if (!box_->GetBounds().Contains(touch.x, touch.y)) {
|
||||
TriggerFinish(DR_BACK);
|
||||
}
|
||||
|
||||
return UIDialogScreen::touch(touch);
|
||||
UIDialogScreen::touch(touch);
|
||||
}
|
||||
|
||||
bool PopupScreen::key(const KeyInput &key) {
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
void deviceLost() override;
|
||||
void deviceRestored() override;
|
||||
|
||||
bool touch(const TouchInput &touch) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
bool key(const KeyInput &touch) override;
|
||||
bool axis(const AxisInput &touch) override;
|
||||
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
virtual void CreatePopupContents(UI::ViewGroup *parent) = 0;
|
||||
void CreateViews() override;
|
||||
bool isTransparent() const override { return true; }
|
||||
bool touch(const TouchInput &touch) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
bool key(const KeyInput &key) override;
|
||||
|
||||
void TriggerFinish(DialogResult result) override;
|
||||
|
|
|
@ -672,7 +672,7 @@ UI::EventReturn AnalogSetupScreen::OnResetToDefaults(UI::EventParams &e) {
|
|||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
bool TouchTestScreen::touch(const TouchInput &touch) {
|
||||
void TouchTestScreen::touch(const TouchInput &touch) {
|
||||
UIDialogScreenWithGameBackground::touch(touch);
|
||||
if (touch.flags & TOUCH_DOWN) {
|
||||
bool found = false;
|
||||
|
@ -721,7 +721,6 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
|
|||
WARN_LOG(SYSTEM, "Touch release without touch down");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TouchTestScreen::CreateViews() {
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool touch(const TouchInput &touch) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
void render() override;
|
||||
|
||||
bool key(const KeyInput &key) override;
|
||||
|
|
|
@ -560,14 +560,14 @@ inline float clamp1(float x) {
|
|||
return x;
|
||||
}
|
||||
|
||||
bool EmuScreen::touch(const TouchInput &touch) {
|
||||
void EmuScreen::touch(const TouchInput &touch) {
|
||||
Core_NotifyActivity();
|
||||
|
||||
if (chatMenu_ && chatMenu_->GetVisibility() == UI::V_VISIBLE) {
|
||||
// Avoid pressing touch button behind the chat
|
||||
if (chatMenu_->Contains(touch.x, touch.y)) {
|
||||
chatMenu_->Touch(touch);
|
||||
return true;
|
||||
return;
|
||||
} else if ((touch.flags & TOUCH_DOWN) != 0) {
|
||||
chatMenu_->Close();
|
||||
if (chatButton_)
|
||||
|
@ -578,9 +578,6 @@ bool EmuScreen::touch(const TouchInput &touch) {
|
|||
|
||||
if (root_) {
|
||||
root_->Touch(touch);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
void sendMessage(const char *msg, const char *value) override;
|
||||
void resized() override;
|
||||
|
||||
bool touch(const TouchInput &touch) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
bool key(const KeyInput &key) override;
|
||||
bool axis(const AxisInput &axis) override;
|
||||
|
||||
|
|
|
@ -744,12 +744,10 @@ bool LogoScreen::key(const KeyInput &key) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool LogoScreen::touch(const TouchInput &touch) {
|
||||
void LogoScreen::touch(const TouchInput &touch) {
|
||||
if (touch.flags & TOUCH_DOWN) {
|
||||
Next();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LogoScreen::render() {
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
LogoScreen(AfterLogoScreen afterLogoScreen = AfterLogoScreen::DEFAULT);
|
||||
|
||||
bool key(const KeyInput &key) override;
|
||||
bool touch(const TouchInput &touch) override;
|
||||
void touch(const TouchInput &touch) override;
|
||||
void update() override;
|
||||
void render() override;
|
||||
void sendMessage(const char *message, const char *value) override;
|
||||
|
|
Loading…
Add table
Reference in a new issue