Skip to content

Commit

Permalink
Remove CanAquireDevice which breaks Acquire() call
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Aug 13, 2024
1 parent 0ba9251 commit 7d0a928
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 76
#define BUILD_NUMBER 77
15 changes: 1 addition & 14 deletions IDirectInputDeviceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,6 @@ HRESULT m_IDirectInputDeviceX::Acquire()
{
Logging::LogDebug() << __FUNCTION__ << " (" << this << ")";

if (!CanAquireDevice)
{
CanAquireDevice = true;
return DIERR_NOTINITIALIZED;
}

return ProxyInterface->Acquire();
}

Expand Down Expand Up @@ -583,14 +577,7 @@ HRESULT m_IDirectInputDeviceX::SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
{
Logging::LogDebug() << __FUNCTION__ << " (" << this << ")";

HRESULT hr = ProxyInterface->SetCooperativeLevel(hwnd, dwFlags);

if (SUCCEEDED(hr))
{
CanAquireDevice = true;
}

return hr;
return ProxyInterface->SetCooperativeLevel(hwnd, dwFlags);
}

template HRESULT m_IDirectInputDeviceX::GetObjectInfoX<IDirectInputDevice8A, LPDIDEVICEOBJECTINSTANCEA>(LPDIDEVICEOBJECTINSTANCEA, DWORD, DWORD);
Expand Down
3 changes: 0 additions & 3 deletions IDirectInputDeviceX.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class m_IDirectInputDeviceX : public AddressLookupTableDinputObject
// Vector to store instances of m_IDirectInputEffect
std::vector<m_IDirectInputEffect*> effects;

// For CooperativeLevel
bool CanAquireDevice = false;

// For GetDeviceData
bool IsMouse = false;

Expand Down

0 comments on commit 7d0a928

Please sign in to comment.