Netplay / Qt: remove ping widget from mainwindow.

This commit is contained in:
HeatXD 2023-05-10 05:01:55 +02:00
parent c2e75c4daa
commit 8a7cbf2f66
No known key found for this signature in database
GPG Key ID: BF30D71B2F1305C7
4 changed files with 7 additions and 20 deletions

View File

@ -523,10 +523,6 @@ void Netplay::HandleEnetEvent(const ENetEvent* event)
{
HandleControlMessage(player_id, event->packet);
}
else if (event->channelID == ENET_CHANNEL_SESSION)
{
HandleSessionMessage(player_id, event->packet);
}
else if (event->channelID == ENET_CHANNEL_GGPO)
{
Log_TracePrintf("Received %zu ggpo bytes from player %d", event->packet->dataLength, player_id);
@ -534,6 +530,10 @@ void Netplay::HandleEnetEvent(const ENetEvent* event)
if (rc != GGPO_OK)
Log_ErrorPrintf("Failed to process GGPO packet!");
}
else if (event->channelID == ENET_CHANNEL_SESSION)
{
HandleSessionMessage(player_id, event->packet);
}
else
{
Log_ErrorPrintf("Unexpected packet channel %u", event->channelID);
@ -1095,7 +1095,7 @@ void Netplay::HandleSessionChatMessage(s32 player_id, const ENetPacket* pkt)
std::string message(pkt->data + sizeof(SessionChatMessage),
pkt->data + sizeof(SessionChatMessage) + msg->chat_message_size);
Host::OnNetplayMessage(fmt::format("Player {}: {}", player_id + 1, message));
Host::OnNetplayMessage(fmt::format("Player {}: {}", PlayerIdToGGPOHandle(player_id), message));
}
void Netplay::CheckForCompleteResynchronize()
@ -1132,6 +1132,8 @@ void Netplay::SetSettings()
// no block linking, it degrades savestate loading performance
si.SetBoolValue("CPU", "RecompilerBlockLinking", false);
// not sure its needed but enabled for now... TODO
si.SetBoolValue("GPU", "UseSoftwareRendererForReadbacks", true);
Host::Internal::SetNetplaySettingsLayer(&si);
System::ApplySettings(false);

View File

@ -1568,10 +1568,6 @@ void MainWindow::setupAdditionalUi()
m_status_vps_widget->setFixedSize(120, 16);
m_status_vps_widget->hide();
m_status_ping_widget = new QLabel(m_ui.statusBar);
m_status_ping_widget->setFixedSize(110, 16);
m_status_ping_widget->hide();
m_settings_toolbar_menu = new QMenu(m_ui.toolBar);
m_settings_toolbar_menu->addAction(m_ui.actionSettings);
m_settings_toolbar_menu->addAction(m_ui.actionViewGameProperties);
@ -1777,7 +1773,6 @@ void MainWindow::updateStatusBarWidgetVisibility()
Update(m_status_resolution_widget, s_system_valid && !s_system_paused, 0);
Update(m_status_fps_widget, s_system_valid && !s_system_paused, 0);
Update(m_status_vps_widget, s_system_valid && !s_system_paused, 0);
Update(m_status_ping_widget, s_system_valid && !s_system_paused && m_netplay_window != nullptr, 0);
}
void MainWindow::updateWindowTitle()

View File

@ -90,7 +90,6 @@ public:
ALWAYS_INLINE QLabel* getStatusResolutionWidget() const { return m_status_resolution_widget; }
ALWAYS_INLINE QLabel* getStatusFPSWidget() const { return m_status_fps_widget; }
ALWAYS_INLINE QLabel* getStatusVPSWidget() const { return m_status_vps_widget; }
ALWAYS_INLINE QLabel* getStatusPingWidget() const { return m_status_ping_widget; }
public Q_SLOTS:
/// Updates debug menu visibility (hides if disabled).
@ -266,7 +265,6 @@ private:
QLabel* m_status_renderer_widget = nullptr;
QLabel* m_status_fps_widget = nullptr;
QLabel* m_status_vps_widget = nullptr;
QLabel* m_status_ping_widget = nullptr;
QLabel* m_status_resolution_widget = nullptr;
QMenu* m_settings_toolbar_menu = nullptr;

View File

@ -1709,14 +1709,6 @@ void EmuThread::updatePerformanceCounters()
m_last_speed = speed;
m_last_video_fps = vfps;
}
const s32 ping = Netplay::GetPing();
if (m_last_ping != ping)
{
QMetaObject::invokeMethod(g_main_window->getStatusPingWidget(), "setText", Qt::QueuedConnection,
Q_ARG(const QString&, tr("Netplay Ping: %1 ").arg(ping, 0, 'f', 0)));
m_last_ping = ping;
}
}
void EmuThread::resetPerformanceCounters()