GS: finish unicode conversion, fix signature inheritance and non wchar external import

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-01-28 13:47:35 +01:00 committed by refractionpcsx2
parent 5917029788
commit 8bfe851446
5 changed files with 13 additions and 7 deletions

View File

@ -197,7 +197,7 @@ GSSource : public CBaseFilter, private CCritSec, public IGSSource
public:
GSSource(int w, int h, float fps, IUnknown* pUnk, HRESULT& hr, int colorspace)
: CBaseFilter(NAME("GSSource"), pUnk, this, __uuidof(this), &hr)
: CBaseFilter("GSSource", pUnk, this, __uuidof(this), &hr)
, m_output(NULL)
, m_size(w, h)
, m_atpf((REFERENCE_TIME)(10000000.0f / fps))

View File

@ -177,11 +177,14 @@ GSVector4i GSWndDX::GetClientRect()
// Returns FALSE if the window has no title, or if th window title is under the strict
// management of the emulator.
bool GSWndDX::SetWindowText(const wchar_t* title)
bool GSWndDX::SetWindowText(const char* title)
{
if(!m_managed) return false;
::SetWindowText(m_hWnd, title);
const size_t tmp_size = strlen(title) + 1;
std::wstring tmp(tmp_size, L'#');
mbstowcs(&tmp[0], title, tmp_size);
::SetWindowText(m_hWnd, tmp.c_str());
return m_frame;
}

View File

@ -43,7 +43,7 @@ public:
void* GetDisplay() {return m_hWnd;}
void* GetHandle() {return m_hWnd;}
GSVector4i GetClientRect();
bool SetWindowText(const wchar_t* title);
bool SetWindowText(const char* title);
void Show();
void Hide();

View File

@ -376,12 +376,15 @@ void GSWndWGL::HideFrame()
// Returns FALSE if the window has no title, or if th window title is under the strict
// management of the emulator.
bool GSWndWGL::SetWindowText(const wchar_t* title)
bool GSWndWGL::SetWindowText(const char* title)
{
if (!m_managed) return false;
const size_t tmp_size = strlen(title) + 1;
std::wstring tmp(tmp_size, L'#');
mbstowcs(&tmp[0], title, tmp_size);
// Used by GSReplay.
::SetWindowText(m_NativeWindow, title);
::SetWindowText(m_NativeWindow, tmp.c_str());
return true;
}

View File

@ -54,7 +54,7 @@ public:
void* GetDisplay() {return m_NativeWindow;}
void* GetHandle() {return m_NativeWindow;}
GSVector4i GetClientRect();
bool SetWindowText(const wchar_t* title);
bool SetWindowText(const char* title);
void AttachContext();
void DetachContext();