mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Calibrated emulated Wiimote aiming in widescreen mode. Added config menu to Wiimote. Added hide cursor option to OpenGL plugin. Added custom Wii settings and moved SYSCONF to User/Config (it will be copied by the game to Wii/shared2/sys when a game is run). Made the DSP and Video debugging windowses run on the same dll instance as the main instance.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1188 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="Plugin_VideoOGL"
|
||||
ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
|
||||
RootNamespace="Plugin_VideoOGL"
|
||||
|
@ -45,6 +45,9 @@ void Config::Load()
|
||||
|
||||
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
|
||||
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0);
|
||||
iniFile.Get("Settings", "StretchToFit", &bStretchToFit, false);
|
||||
iniFile.Get("Settings", "KeepAR", &bKeepAR, false);
|
||||
iniFile.Get("Settings", "HideCursor", &bHideCursor, false);
|
||||
|
||||
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
|
||||
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
|
||||
@ -73,8 +76,7 @@ void Config::Load()
|
||||
|
||||
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
||||
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
||||
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
|
||||
iniFile.Get("Enhancements", "KeepAR", &bKeepAR, false);
|
||||
|
||||
|
||||
iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0);
|
||||
}
|
||||
@ -87,6 +89,9 @@ void Config::Save()
|
||||
iniFile.Set("Hardware", "FullscreenRes", iFSResolution);
|
||||
iniFile.Set("Hardware", "Fullscreen", bFullscreen);
|
||||
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);
|
||||
iniFile.Set("Settings", "StretchToFit", bStretchToFit);
|
||||
iniFile.Set("Settings", "KeepAR", bKeepAR);
|
||||
iniFile.Set("Settings", "HideCursor", bHideCursor);
|
||||
|
||||
iniFile.Set("Settings", "ShowFPS", bShowFPS);
|
||||
iniFile.Set("Settings", "OverlayStats", bOverlayStats);
|
||||
@ -105,8 +110,6 @@ void Config::Save()
|
||||
|
||||
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
||||
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
||||
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
|
||||
iniFile.Set("Enhancements", "KeepAR", bKeepAR);
|
||||
|
||||
iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable);
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct Config
|
||||
char iWindowedRes[16];
|
||||
bool bStretchToFit;
|
||||
bool bKeepAR;
|
||||
bool bHideCursor;
|
||||
|
||||
// Enhancements
|
||||
int iMultisampleMode;
|
||||
|
@ -35,6 +35,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||
EVT_CHECKBOX(ID_FORCEANISOTROPY, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STRETCHTOFIT, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIDECURSOR, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_WIREFRAME, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWFPS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged)
|
||||
@ -98,6 +99,8 @@ void ConfigDialog::CreateGUIControls()
|
||||
m_StretchToFit->SetValue(g_Config.bStretchToFit);
|
||||
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_KeepAR->SetValue(g_Config.bKeepAR);
|
||||
m_HideCursor = new wxCheckBox(m_PageGeneral, ID_HIDECURSOR, wxT("Hide mouse cursor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_HideCursor->SetValue(g_Config.bHideCursor);
|
||||
wxStaticText *FSText = new wxStaticText(m_PageGeneral, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
|
||||
m_FullscreenCB->SetValue(wxString::FromAscii(g_Config.iFSResolution));
|
||||
@ -119,16 +122,18 @@ void ConfigDialog::CreateGUIControls()
|
||||
tmp<<g_Config.iMultisampleMode;
|
||||
m_AliasModeCB->SetValue(tmp);
|
||||
|
||||
// Usage: The wxGBPosition() must have a column and row
|
||||
sGeneral = new wxBoxSizer(wxVERTICAL);
|
||||
sBasic = new wxGridBagSizer(0, 0);
|
||||
sBasic->Add(m_Fullscreen, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_RenderToMainWindow, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_StretchToFit, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(m_KeepAR, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(FSText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_FullscreenCB, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(WMText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_WindowResolutionCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(m_HideCursor, wxGBPosition(4, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sBasic->Add(FSText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_FullscreenCB, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(WMText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBasic->Add(m_WindowResolutionCB, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sbBasic->Add(sBasic);
|
||||
sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
@ -222,6 +227,8 @@ void ConfigDialog::CreateGUIControls()
|
||||
|
||||
void ConfigDialog::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
{
|
||||
/* notice that we don't run wxEntryCleanup(); here so the dll will
|
||||
still be loaded */
|
||||
g_Config.Save();
|
||||
EndModal(0);
|
||||
}
|
||||
@ -272,6 +279,9 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
case ID_KEEPAR:
|
||||
g_Config.bKeepAR = m_KeepAR->IsChecked();
|
||||
break;
|
||||
case ID_HIDECURSOR:
|
||||
g_Config.bHideCursor = m_HideCursor->IsChecked();
|
||||
break;
|
||||
case ID_FULLSCREENCB:
|
||||
strcpy(g_Config.iFSResolution, m_FullscreenCB->GetValue().mb_str() );
|
||||
break;
|
||||
|
@ -73,11 +73,13 @@ class ConfigDialog : public wxDialog
|
||||
wxCheckBox *m_RenderToMainWindow;
|
||||
wxCheckBox *m_StretchToFit;
|
||||
wxCheckBox *m_KeepAR;
|
||||
wxCheckBox *m_HideCursor;
|
||||
wxArrayString arrayStringFor_FullscreenCB;
|
||||
wxComboBox *m_FullscreenCB;
|
||||
wxArrayString arrayStringFor_WindowResolutionCB;
|
||||
wxComboBox *m_WindowResolutionCB;
|
||||
wxCheckBox *m_ForceFiltering;
|
||||
|
||||
wxCheckBox *m_ForceFiltering; // advanced
|
||||
wxCheckBox *m_ForceAnisotropy;
|
||||
wxComboBox *m_AliasModeCB;
|
||||
wxCheckBox *m_ShowFPS;
|
||||
@ -106,6 +108,7 @@ class ConfigDialog : public wxDialog
|
||||
ID_RENDERTOMAINWINDOW,
|
||||
ID_STRETCHTOFIT,
|
||||
ID_KEEPAR,
|
||||
ID_HIDECURSOR,
|
||||
ID_FSTEXT,
|
||||
ID_FULLSCREENCB,
|
||||
ID_WMTEXT,
|
||||
|
@ -89,6 +89,21 @@ namespace EmuWindow
|
||||
const TCHAR m_szClassName[] = "DolphinEmuWnd";
|
||||
int g_winstyle;
|
||||
|
||||
// ------------------------------------------
|
||||
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
|
||||
an empty transparent cursor */
|
||||
// ------------------
|
||||
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
||||
void CreateCursors(HINSTANCE hInstance)
|
||||
{
|
||||
BYTE ANDmaskCursor[] = { 0xff };
|
||||
BYTE XORmaskCursor[] = { 0x00 };
|
||||
hCursorBlank = CreateCursor(hInstance, 0,0, 1,1, ANDmaskCursor,XORmaskCursor);
|
||||
|
||||
hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
}
|
||||
|
||||
|
||||
HWND GetWnd()
|
||||
{
|
||||
return m_hWnd;
|
||||
@ -125,6 +140,18 @@ namespace EmuWindow
|
||||
g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0);
|
||||
break;
|
||||
|
||||
/* The reason we pick up the WM_MOUSEMOVE is to be able to change this option
|
||||
during gameplay. The alternative is to load one of the cursors when the plugin
|
||||
is loaded and go with that. This should only produce a minimal performance hit
|
||||
because SetCursor is not supposed to actually change the cursor if it's the
|
||||
same as the one before. */
|
||||
case WM_MOUSEMOVE:
|
||||
if(g_Config.bHideCursor)
|
||||
SetCursor(hCursorBlank);
|
||||
else
|
||||
SetCursor(hCursor);
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
ExitProcess(0);
|
||||
|
||||
@ -159,7 +186,8 @@ namespace EmuWindow
|
||||
wndClass.cbWndExtra = 0;
|
||||
wndClass.hInstance = hInstance;
|
||||
wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
|
||||
wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
//wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wndClass.hCursor = NULL; // to interfer less with SetCursor() later
|
||||
wndClass.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
|
||||
wndClass.lpszMenuName = NULL;
|
||||
wndClass.lpszClassName = m_szClassName;
|
||||
@ -168,6 +196,8 @@ namespace EmuWindow
|
||||
m_hInstance = hInstance;
|
||||
RegisterClassEx( &wndClass );
|
||||
|
||||
CreateCursors(m_hInstance);
|
||||
|
||||
if (parent)
|
||||
{
|
||||
m_hWnd = CreateWindow(m_szClassName, title,
|
||||
@ -216,11 +246,13 @@ namespace EmuWindow
|
||||
|
||||
// gShowDebugger from main.cpp is forgotten between the Dolphin-Debugger is opened and a game is
|
||||
// started so we have to use an ini file setting here
|
||||
/*
|
||||
bool bVideoWindow = false;
|
||||
IniFile ini;
|
||||
ini.Load(DEBUGGER_CONFIG_FILE);
|
||||
ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false);
|
||||
if(bVideoWindow) DoDllDebugger();
|
||||
*/
|
||||
}
|
||||
|
||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
||||
|
@ -54,33 +54,42 @@
|
||||
SVideoInitialize g_VideoInitialize;
|
||||
#define VERSION_STRING "0.1"
|
||||
|
||||
// Create debugging window. We can't use Show() here as usual because then DLL_PROCESS_DETACH will
|
||||
// be called immediately. And if we use ShowModal() we block the main video window from appearing.
|
||||
// So I've made a separate function called DoDllDebugger() that creates the window.
|
||||
|
||||
/* Create debugging window. There's currently a strange crash that occurs whe a game is loaded
|
||||
if the OpenGL plugin was loaded before. I'll try to fix that. Currently you may have to
|
||||
clsoe the window if it has auto started, and then restart it after the dll has loaded
|
||||
for the purpose of the game. At that point there is no need to use the same dll instance
|
||||
as the one that is rendering the game. However, that could be done. */
|
||||
#if defined(OSX64)
|
||||
void DllDebugger(HWND _hParent) { }
|
||||
void DoDllDebugger() { }
|
||||
#else
|
||||
CDebugger* m_frame;
|
||||
void DllDebugger(HWND _hParent)
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
{
|
||||
if(m_frame) // if we have created it, let us show it again
|
||||
if(m_frame && Show) // if we have created it, let us show it again
|
||||
{
|
||||
m_frame->Show();
|
||||
}
|
||||
else
|
||||
else if(!m_frame && Show)
|
||||
{
|
||||
m_frame = new CDebugger(NULL);
|
||||
m_frame->Show();
|
||||
}
|
||||
else if(m_frame && !Show)
|
||||
{
|
||||
wxMessageBox(_T("The debugging window will open after you start a game."));
|
||||
m_frame->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
void DoDllDebugger()
|
||||
{
|
||||
m_frame = new CDebugger(NULL);
|
||||
m_frame->Show();
|
||||
//m_frame = new CDebugger(NULL);
|
||||
//m_frame->Show();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
{
|
||||
_PluginInfo->Version = 0x0100;
|
||||
@ -99,9 +108,13 @@ void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
wxWindow win;
|
||||
win.SetHWND(_hParent);
|
||||
ConfigDialog frame(&win);
|
||||
//wxWindow win;
|
||||
//win.SetHWND(_hParent);
|
||||
//ConfigDialog frame(&win);
|
||||
//ConfigDialog frame(NULL);
|
||||
|
||||
ConfigDialog *frame;
|
||||
frame = new ConfigDialog(NULL);
|
||||
|
||||
DWORD iModeNum = 0;
|
||||
DEVMODE dmi;
|
||||
@ -130,13 +143,16 @@ void DllConfig(HWND _hParent)
|
||||
{
|
||||
resos[i] = strBuffer;
|
||||
i++;
|
||||
frame.AddFSReso(szBuffer);
|
||||
frame.AddWindowReso(szBuffer);
|
||||
//frame.AddFSReso(szBuffer);
|
||||
//frame.AddWindowReso(szBuffer);
|
||||
frame->AddFSReso(szBuffer);
|
||||
frame->AddWindowReso(szBuffer);
|
||||
}
|
||||
ZeroMemory(&dmi, sizeof(dmi));
|
||||
}
|
||||
frame.ShowModal();
|
||||
win.SetHWND(0);
|
||||
//frame.ShowModal();
|
||||
frame->ShowModal();
|
||||
//win.SetHWND(0);
|
||||
|
||||
#elif defined(__linux__)
|
||||
ConfigDialog frame(NULL);
|
||||
@ -185,7 +201,16 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
|
||||
#ifdef _WIN32
|
||||
// OpenConsole();
|
||||
#endif
|
||||
|
||||
|
||||
/* Dolphin currently crashes if the dll is loaded when a game is started so we clsoe the
|
||||
debugger and open it again after loading */
|
||||
/*
|
||||
if(m_frame)
|
||||
{
|
||||
m_frame->EndModal(0); wxEntryCleanup();
|
||||
}//use wxUninitialize() if you don't want GUI
|
||||
*/
|
||||
|
||||
frameCount = 0;
|
||||
g_VideoInitialize = *_pVideoInitialize;
|
||||
InitLUTs();
|
||||
@ -323,4 +348,4 @@ void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset)
|
||||
void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
{
|
||||
Renderer::AddMessage(pstr,milliseconds);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user