mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
windows: added resolutions and made the window sizing a bit better. linux: #include fix
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@141 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a44e94a594
commit
9dc48651a7
@ -188,7 +188,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
if (g_Config.bFullscreen) {
|
if (g_Config.bFullscreen) {
|
||||||
dwExStyle=WS_EX_APPWINDOW;
|
dwExStyle=WS_EX_APPWINDOW;
|
||||||
dwStyle=WS_POPUP;
|
dwStyle=WS_POPUP;
|
||||||
ShowCursor(FALSE);
|
//ShowCursor(FALSE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
||||||
@ -202,7 +202,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
||||||
|
|
||||||
// SetWindowPos(EmuWindow::GetWnd(), NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION|SWP_NOZORDER);
|
SetWindowPos(EmuWindow::GetWnd(), NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION|SWP_NOZORDER);
|
||||||
|
|
||||||
PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be
|
PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "ConfigDlg.h"
|
#include "ConfigDlg.h"
|
||||||
#include "../Globals.h"
|
#include "../Globals.h"
|
||||||
|
|
||||||
#include "TextureMngr.h"
|
#include "../TextureMngr.h"
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||||
EVT_CLOSE(ConfigDialog::OnClose)
|
EVT_CLOSE(ConfigDialog::OnClose)
|
||||||
@ -92,11 +92,13 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
|
|
||||||
wxStaticText *FSText = new wxStaticText(m_PageVideo, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText *FSText = new wxStaticText(m_PageVideo, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
wxArrayString arrayStringFor_FullscreenCB;
|
wxArrayString arrayStringFor_FullscreenCB;
|
||||||
m_FullscreenCB = new wxComboBox(m_PageVideo, ID_FULLSCREENCB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
|
m_FullscreenCB = new wxComboBox(m_PageVideo, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
|
||||||
|
m_FullscreenCB->SetValue(g_Config.iFSResolution);
|
||||||
|
|
||||||
wxStaticText *WMText = new wxStaticText(m_PageVideo, ID_WMTEXT, wxT("Windowed resolution:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText *WMText = new wxStaticText(m_PageVideo, ID_WMTEXT, wxT("Windowed resolution:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
wxArrayString arrayStringFor_WindowResolutionCB;
|
wxArrayString arrayStringFor_WindowResolutionCB;
|
||||||
m_WindowResolutionCB = new wxComboBox(m_PageVideo, ID_WINDOWRESOLUTIONCB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator);
|
m_WindowResolutionCB = new wxComboBox(m_PageVideo, ID_WINDOWRESOLUTIONCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator);
|
||||||
|
m_WindowResolutionCB->SetValue(g_Config.iWindowedRes);
|
||||||
|
|
||||||
//page2
|
//page2
|
||||||
m_ForceFiltering = new wxCheckBox(m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (May cause small glitches)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_ForceFiltering = new wxCheckBox(m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (May cause small glitches)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
@ -124,7 +126,7 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_AliasModeCB, 0, wxDefaultValidator);
|
m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_AliasModeCB, 0, wxDefaultValidator);
|
||||||
m_AliasModeCB->Enable(false);
|
m_AliasModeCB->Enable(false);
|
||||||
|
|
||||||
m_ForceAnisotropy = new wxCheckBox(m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Force maximum ansitropy filtering"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_ForceAnisotropy = new wxCheckBox(m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Force maximum anisotropy filtering"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
//m_ForceAnisotropy->SetValue(g_Config.bForceMaxAniso);
|
//m_ForceAnisotropy->SetValue(g_Config.bForceMaxAniso);
|
||||||
m_ForceAnisotropy->Enable(false);
|
m_ForceAnisotropy->Enable(false);
|
||||||
|
|
||||||
@ -168,8 +170,8 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
sPage3->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
|
sPage3->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_TexFmtOverlay, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
|
sPage3->Add(m_TexFmtOverlay, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_TexFmtCenter, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
|
sPage3->Add(m_TexFmtCenter, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_DumpTextures, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
sPage3->Add(m_DumpTextures, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_TexturePath, wxGBPosition(4, 1), wxGBSpan(2, 1), wxALL, 5);
|
sPage3->Add(m_TexturePath, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||||
m_PageAdvanced->SetSizer(sPage3);
|
m_PageAdvanced->SetSizer(sPage3);
|
||||||
sPage3->Layout();
|
sPage3->Layout();
|
||||||
|
|
||||||
@ -211,7 +213,6 @@ void ConfigDialog::AddFSReso(char *reso)
|
|||||||
m_FullscreenCB->Append(wxString::FromAscii(reso));
|
m_FullscreenCB->Append(wxString::FromAscii(reso));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConfigDialog::FSCB(wxCommandEvent& event)
|
void ConfigDialog::FSCB(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() );
|
strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() );
|
||||||
@ -255,14 +256,17 @@ void ConfigDialog::TexFmtOverlayChange(wxCommandEvent& event)
|
|||||||
switch(event.GetId())
|
switch(event.GetId())
|
||||||
{
|
{
|
||||||
case ID_TEXFMTOVERLAY:
|
case ID_TEXFMTOVERLAY:
|
||||||
|
|
||||||
g_Config.bTexFmtOverlayEnable = m_TexFmtOverlay->IsChecked();
|
g_Config.bTexFmtOverlayEnable = m_TexFmtOverlay->IsChecked();
|
||||||
m_TexFmtCenter->Enable(m_TexFmtOverlay->IsChecked());
|
m_TexFmtCenter->Enable(m_TexFmtOverlay->IsChecked());
|
||||||
TextureMngr::Invalidate();
|
TextureMngr::Invalidate();
|
||||||
if(!g_Config.bTexFmtOverlayEnable)
|
if(!g_Config.bTexFmtOverlayEnable)
|
||||||
|
{
|
||||||
m_TexFmtCenter->SetValue(false);
|
m_TexFmtCenter->SetValue(false);
|
||||||
else
|
g_Config.bTexFmtOverlayCenter = false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ID_TEXFMTCENTER:
|
case ID_TEXFMTCENTER:
|
||||||
g_Config.bTexFmtOverlayCenter = m_TexFmtCenter->IsChecked();
|
g_Config.bTexFmtOverlayCenter = m_TexFmtCenter->IsChecked();
|
||||||
|
@ -66,12 +66,32 @@ void DllConfig(HWND _hParent)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
wxWindow win;
|
wxWindow win;
|
||||||
win.SetHWND(_hParent);
|
win.SetHWND(_hParent);
|
||||||
|
|
||||||
//TODO get available resolutions
|
|
||||||
|
|
||||||
ConfigDialog frame(&win);
|
ConfigDialog frame(&win);
|
||||||
frame.ShowModal();
|
|
||||||
|
|
||||||
|
DWORD iModeNum = 0;
|
||||||
|
DEVMODE dmi;
|
||||||
|
|
||||||
|
ZeroMemory(&dmi, sizeof(dmi));
|
||||||
|
dmi.dmSize = sizeof(dmi);
|
||||||
|
|
||||||
|
int x = 0, y = 0;
|
||||||
|
|
||||||
|
while(EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0)
|
||||||
|
{
|
||||||
|
//TODO check against all older resolutions, not just the previous
|
||||||
|
if(x != dmi.dmPelsWidth && y != dmi.dmPelsHeight && dmi.dmBitsPerPel == 32)
|
||||||
|
{
|
||||||
|
char szBuffer[100];
|
||||||
|
sprintf(szBuffer,"%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);
|
||||||
|
frame.AddFSReso(szBuffer);
|
||||||
|
frame.AddWindowReso(szBuffer);
|
||||||
|
x = dmi.dmPelsWidth;
|
||||||
|
y = dmi.dmPelsHeight;
|
||||||
|
}
|
||||||
|
ZeroMemory(&dmi, sizeof(dmi));
|
||||||
|
}
|
||||||
|
|
||||||
|
frame.ShowModal();
|
||||||
win.SetHWND(0);
|
win.SetHWND(0);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -90,7 +110,7 @@ void DllConfig(HWND _hParent)
|
|||||||
int modeNum = 0;
|
int modeNum = 0;
|
||||||
int bestMode = 0;
|
int bestMode = 0;
|
||||||
|
|
||||||
// set best mode to current
|
//set best mode to current
|
||||||
bestMode = 0;
|
bestMode = 0;
|
||||||
XF86VidModeGetAllModeLines(GLWin.dpy, GLWin.screen, &modeNum, &modes);
|
XF86VidModeGetAllModeLines(GLWin.dpy, GLWin.screen, &modeNum, &modes);
|
||||||
int px = 0, py = 0;
|
int px = 0, py = 0;
|
||||||
@ -103,7 +123,7 @@ void DllConfig(HWND _hParent)
|
|||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp,"%dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
|
sprintf(temp,"%dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
|
||||||
frame.AddFSReso(temp);
|
frame.AddFSReso(temp);
|
||||||
frame.AddWindowReso(temp); //Add same to Window ones, since they should be nearly all that's needed
|
frame.AddWindowReso(temp);//Add same to Window ones, since they should be nearly all that's needed
|
||||||
px = modes[i]->hdisplay;//Used to remove repeating from different screen depths
|
px = modes[i]->hdisplay;//Used to remove repeating from different screen depths
|
||||||
py = modes[i]->vdisplay;
|
py = modes[i]->vdisplay;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user