mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 18:23:43 +01:00
Doesn't yet work
This commit is contained in:
1 parent
729f11ecbe
commit
72ee82844d
16 files changed
+133
-151
No files matched your search
+2
-63
@@ -66,7 +66,7 @@ void UIScreen::DoRecreateViews() {
|
||||
WipeRequesterToken();
|
||||
}
|
||||
|
||||
void UIScreen::touch(const TouchInput &touch) {
|
||||
bool UIScreen::touch(const TouchInput &touch) {
|
||||
if (ClickDebug && root_ && (touch.flags & TouchInputFlags::DOWN)) {
|
||||
INFO_LOG(Log::System, "Touch down!");
|
||||
std::vector<UI::View *> views;
|
||||
@@ -79,6 +79,7 @@ void UIScreen::touch(const TouchInput &touch) {
|
||||
if (!ignoreInput_ && root_) {
|
||||
UI::TouchEvent(touch, root_);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UIScreen::axis(const AxisInput &axis) {
|
||||
@@ -95,33 +96,6 @@ bool UIScreen::key(const KeyInput &key) {
|
||||
}
|
||||
}
|
||||
|
||||
bool UIScreen::UnsyncTouch(const TouchInput &touch) {
|
||||
QueuedEvent ev{};
|
||||
ev.type = QueuedEventType::TOUCH;
|
||||
ev.touch = touch;
|
||||
std::lock_guard<std::mutex> guard(eventQueueLock_);
|
||||
eventQueue_.push_back(ev);
|
||||
return false;
|
||||
}
|
||||
|
||||
void UIScreen::UnsyncAxis(const AxisInput *axes, size_t count) {
|
||||
QueuedEvent ev{};
|
||||
ev.type = QueuedEventType::AXIS;
|
||||
std::lock_guard<std::mutex> guard(eventQueueLock_);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
ev.axis = axes[i];
|
||||
eventQueue_.push_back(ev);
|
||||
}
|
||||
}
|
||||
|
||||
void UIScreen::UnsyncKey(const KeyInput &key) {
|
||||
QueuedEvent ev{};
|
||||
ev.type = QueuedEventType::KEY;
|
||||
ev.key = key;
|
||||
std::lock_guard<std::mutex> guard(eventQueueLock_);
|
||||
eventQueue_.push_back(ev);
|
||||
}
|
||||
|
||||
void UIScreen::update() {
|
||||
DeviceOrientation orientation = GetDeviceOrientation();
|
||||
if (orientation != lastOrientation_) {
|
||||
@@ -131,41 +105,6 @@ void UIScreen::update() {
|
||||
|
||||
DoRecreateViews();
|
||||
|
||||
while (true) {
|
||||
QueuedEvent ev{};
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(eventQueueLock_);
|
||||
if (!eventQueue_.empty()) {
|
||||
ev = eventQueue_.front();
|
||||
eventQueue_.pop_front();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ignoreInput_) {
|
||||
continue;
|
||||
}
|
||||
switch (ev.type) {
|
||||
case QueuedEventType::KEY:
|
||||
key(ev.key);
|
||||
break;
|
||||
case QueuedEventType::TOUCH:
|
||||
if (ClickDebug && (ev.touch.flags & TouchInputFlags::DOWN)) {
|
||||
INFO_LOG(Log::System, "Touch down!");
|
||||
std::vector<UI::View *> views;
|
||||
root_->Query(ev.touch.x, ev.touch.y, views);
|
||||
for (auto view : views) {
|
||||
INFO_LOG(Log::System, "%s", view->DescribeLog().c_str());
|
||||
}
|
||||
}
|
||||
touch(ev.touch);
|
||||
break;
|
||||
case QueuedEventType::AXIS:
|
||||
axis(ev.axis);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (root_) {
|
||||
DialogResult result = UpdateViewHierarchy(root_);
|
||||
if (result != DR_NONE) {
|
||||
|
||||
Reference in new issue
Block a user