Skip to content

Commit

Permalink
・[fix] メインとは別のグラボに繋がれたモニターにウマ娘ウィンドウが存在するときに、画面取り込みができないバグを修正 #80
Browse files Browse the repository at this point in the history
  • Loading branch information
amate committed Oct 10, 2021
1 parent fa012cb commit d44d872
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion UmaCruise/AboutDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PreviewWindow;
#define DEBUG_STRING
#endif

constexpr LPCWSTR kAppVersion = L"v1.15.2" DEBUG_STRING;
constexpr LPCWSTR kAppVersion = L"v1.15.3" DEBUG_STRING;

class CAboutDlg : public CDialogImpl<CAboutDlg>, DarkModeUI<CAboutDlg>
{
Expand Down
26 changes: 12 additions & 14 deletions UmaCruise/DesktopDuplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@
class DesktopDuplication
{
public:
void Init()
{
// デバイス作成
HRESULT hr = ::D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, D3D11_CREATE_DEVICE_BGRA_SUPPORT, nullptr, 0, D3D11_SDK_VERSION, &m_device, nullptr, &m_deviceContext);
if (FAILED(hr)) {
ERROR_LOG << L"D3D11CreateDevice failed";
throw std::runtime_error("D3D11CreateDevice");
}
}

void Term()
{

}

std::unique_ptr<Gdiplus::Bitmap> ScreenShot(HWND hwndTarget, const CRect& rcAdjustClient)
{
Expand Down Expand Up @@ -144,7 +130,19 @@ class DesktopDuplication
{
output->GetDesc(&m_last_outputDesc);

// hwndTarget のモニターを発見
if (::wcscmp(monitorInfo.szDevice, m_last_outputDesc.DeviceName) == 0) {

// デバイス作成
m_device.Release();
m_deviceContext.Release();
HRESULT hr = ::D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_BGRA_SUPPORT, nullptr, 0, D3D11_SDK_VERSION, &m_device, nullptr, &m_deviceContext);
if (FAILED(hr)) {
ERROR_LOG << L"D3D11CreateDevice failed";
//throw std::runtime_error("D3D11CreateDevice");
return; // failed
}

CComQIPtr<IDXGIOutput1> output1 = output;
output1->DuplicateOutput(m_device, &m_duplication);
ATLASSERT(m_duplication);
Expand Down
1 change: 0 additions & 1 deletion UmaCruise/UmaTextRecognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ bool UmaTextRecognizer::LoadSetting()
std::wstring correct = UTF16fromUTF8(jsonTypo["Corret"].get<std::string>());
m_typoDictionary[typo] = correct;
}
m_desktopDuplication.Init();

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion appversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.15.2
v1.15.3
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ https://www.kiigo.jp/disp/CSfGoodsPage_001.jsp?GOODS_NO=9

<pre>

v1.15.3
・[fix] メインとは別のグラボに繋がれたモニターにウマ娘ウィンドウが存在するときに、画面取り込みができないバグを修正 #80

v1.15.2
・[fix] モニターが回転していると正常に画面取り込みできなかったバグを修正
・[fix] セイウンスカイ(サポート)の連続イベントで間違った選択肢が出るのを修正 #77
Expand Down

0 comments on commit d44d872

Please sign in to comment.