Skip to content

Commit

Permalink
fixup! Games: Add Agent Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
garbear committed Jul 28, 2023
1 parent 16aca8d commit ef0139a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
9 changes: 2 additions & 7 deletions xbmc/games/agents/GameAgentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,15 @@ float CGameAgentManager::GetPortActivation(const std::string& portAddress) const

float CGameAgentManager::GetPeripheralActivation(const std::string& peripheralLocation) const
{
float activation = 0.0f;

std::lock_guard<std::mutex> lock(m_agentMutex);

for (const GameAgentPtr& agent : m_agents)
{
if (agent->GetPeripheralLocation() == peripheralLocation)
{
activation = agent->GetActivation();
break;
}
return agent->GetActivation();
}

return activation;
return 0.0f;
}

void CGameAgentManager::ProcessJoysticks(PERIPHERALS::EventLockHandlePtr& inputHandlingLock)
Expand Down
8 changes: 4 additions & 4 deletions xbmc/games/agents/windows/GUIAgentDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#pragma once

// Skin XML files
#define AGENT_DIALOG_XML "DialogGameControllers.xml"
constexpr auto AGENT_DIALOG_XML = "DialogGameControllers.xml";

// GUI control IDs
#define CONTROL_ACTIVE_PORT_LIST 4
#define CONTROL_AGENT_LIST 5
constexpr auto CONTROL_ACTIVE_PORT_LIST = 4;
constexpr auto CONTROL_AGENT_LIST = 5;

// GUI button IDs
#define CONTROL_AGENT_CLOSE_BUTTON 18
constexpr auto CONTROL_AGENT_CLOSE_BUTTON = 18;
2 changes: 1 addition & 1 deletion xbmc/games/agents/windows/GUIAgentList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ void CGUIAgentList::Notify(const Observable& obs, const ObservableMessage msg)
{
CGUIMessage msg(GUI_MSG_REFRESH_LIST, m_guiWindow.GetID(), CONTROL_AGENT_LIST);
CServiceBroker::GetAppMessenger()->SendGUIMessage(msg, m_guiWindow.GetID());
break;
}
break;
default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion xbmc/games/controllers/guicontrols/GUIGameControllerList.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <vector>

class CScroller;
class TiXmlElement;

namespace KODI
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ void CGUIGameControllerProvider::SetPeripheralLocation(const std::string& periph
void CGUIGameControllerProvider::InitializeItems()
{
m_items.resize(ITEM_COUNT);
for (unsigned int i = 0; i < ITEM_COUNT; ++i)
m_items[i] = std::make_shared<CGUIListItem>();
for (auto& item : m_items)
item = std::make_shared<CGUIListItem>();

UpdateItems();
}
Expand Down

0 comments on commit ef0139a

Please sign in to comment.