Host: Kill off GetRenderWindowSize

This commit is contained in:
Lioncash
2014-11-15 00:11:09 -05:00
parent aa2fc1f66b
commit b94dbca160
13 changed files with 12 additions and 141 deletions

View File

@ -26,7 +26,6 @@
bool Host_UIHasFocus();
bool Host_RendererHasFocus();
void Host_ConnectWiimote(int wm_idx, bool connect);
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height);
void Host_Message(int Id);
void Host_NotifyMapLoaded();
void Host_RefreshDSPDebuggerWindow();

View File

@ -32,14 +32,6 @@ void* Host_GetRenderHandle()
return (void*)(g_main_window->GetRenderWidget()->winId());
}
void Host_GetRenderWindowSize(int& x, int& y, int& w, int& h)
{
// TODO: Make it more clear what this is supposed to return.. i.e. WX always sets x=y=0
g_main_window->RenderWidgetSize(x, y, w, h);
x = 0;
y = 0;
}
void Host_RequestRenderWindowSize(int w, int h)
{
DRenderWidget* render_widget = g_main_window->GetRenderWidget();

View File

@ -221,23 +221,6 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
m_ui->actionOpen->setEnabled(is_not_initialized);
}
// DRenderWidget
void DMainWindow::RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h)
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
x_pos = x();
y_pos = y();
}
else
{
x_pos = m_render_widget->x();
y_pos = m_render_widget->y();
}
w = m_render_widget->width();
h = m_render_widget->height();
}
bool DMainWindow::RenderWidgetHasFocus()
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)

View File

@ -26,7 +26,6 @@ public:
~DMainWindow();
// DRenderWidget
void RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h);
bool RenderWidgetHasFocus();
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }

View File

@ -748,23 +748,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
}
}
void CFrame::GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
#ifdef __WXGTK__
if (!wxIsMainThread())
wxMutexGuiEnter();
#endif
wxRect client_rect = m_RenderParent->GetClientRect();
width = client_rect.width;
height = client_rect.height;
x = client_rect.x;
y = client_rect.y;
#ifdef __WXGTK__
if (!wxIsMainThread())
wxMutexGuiLeave();
#endif
}
void CFrame::OnRenderWindowSizeRequest(int width, int height)
{
if (!Core::IsRunning() ||

View File

@ -113,7 +113,6 @@ public:
void PostEvent(wxCommandEvent& event);
void StatusBarMessage(const char * Text, ...);
void ClearStatusBar();
void GetRenderWindowSize(int& x, int& y, int& width, int& height);
void OnRenderWindowSizeRequest(int width, int height);
void BootGame(const std::string& filename);
void OnRenderParentClose(wxCloseEvent& event);

View File

@ -506,11 +506,6 @@ void Host_UpdateTitle(const std::string& title)
main_frame->GetEventHandler()->AddPendingEvent(event);
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
main_frame->GetRenderWindowSize(x, y, width, height);
}
void Host_RequestRenderWindowSize(int width, int height)
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_WINDOWSIZEREQUEST);

View File

@ -48,7 +48,6 @@
#include "VideoCommon/VideoBackendBase.h"
ANativeWindow* surf;
int g_width, g_height;
std::string g_filename;
#define DOLPHIN_TAG "Dolphinemu"
@ -77,14 +76,6 @@ void Host_UpdateMainFrame()
{
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;
y = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos;
width = g_width;
height = g_height;
}
void Host_RequestRenderWindowSize(int width, int height) {}
void Host_RequestFullscreen(bool enable_fullscreen) {}
@ -311,11 +302,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(
{
g_filename = GetJString(env, jFile);
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetDimensions(JNIEnv *env, jobject obj, jint _width, jint _height)
{
g_width = (int)_width;
g_height = (int)_height;
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv *env, jobject obj, jint slot)
{
@ -348,6 +334,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFo
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
{
surf = ANativeWindow_fromSurface(env, _surf);
// Install our callbacks
OSD::AddCallback(OSD::OSD_INIT, ButtonManager::Init);
OSD::AddCallback(OSD::OSD_SHUTDOWN, ButtonManager::Shutdown);

View File

@ -72,14 +72,6 @@ void Host_UpdateMainFrame()
updateMainFrameEvent.Set();
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;
y = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos;
width = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth;
height = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight;
}
void Host_RequestRenderWindowSize(int width, int height) {}
void Host_RequestFullscreen(bool enable_fullscreen) {}

View File

@ -16,8 +16,8 @@ EGLNativeWindowType cInterfaceEGLAndroid::InitializePlatform(EGLNativeWindowType
eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(host_window, 0, 0, format);
int none, width, height;
Host_GetRenderWindowSize(none, none, width, height);
const int width = ANativeWindow_getWidth(host_window);
const int height = ANativeWindow_getHeight(host_window);
GLInterface->SetBackBufferDimensions(width, height);
return host_window;