mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Wiimote: reapply the Upright wiimote option
D3D: add the EFB Copy option to complete Rodolfo's commit plus add the Overlay FPS and the Disable Fog options also change the config dialog's behaviour a bit git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4622 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -36,6 +36,8 @@
|
|||||||
extern int frameCount;
|
extern int frameCount;
|
||||||
extern int OSDChoice, OSDTime, OSDInternalW, OSDInternalH;
|
extern int OSDChoice, OSDTime, OSDInternalW, OSDInternalH;
|
||||||
|
|
||||||
|
static int s_fps=0;
|
||||||
|
|
||||||
// Renderer really isn't a very good name for this class - it's more like "Misc".
|
// Renderer really isn't a very good name for this class - it's more like "Misc".
|
||||||
// The long term goal is to get rid of this class and replace it with others that make
|
// The long term goal is to get rid of this class and replace it with others that make
|
||||||
// more sense.
|
// more sense.
|
||||||
|
@ -126,7 +126,7 @@ bool GetConfig(const int &type)
|
|||||||
case CONFIG_ISWII:
|
case CONFIG_ISWII:
|
||||||
return g_VideoInitialize.bWii;
|
return g_VideoInitialize.bWii;
|
||||||
case CONFIG_DISABLEFOG:
|
case CONFIG_DISABLEFOG:
|
||||||
return false;
|
return g_ActiveConfig.bDisableFog;
|
||||||
case CONFIG_SHOWEFBREGIONS:
|
case CONFIG_SHOWEFBREGIONS:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
|
@ -79,6 +79,7 @@ struct TabDirect3D : public W32Util::Tab
|
|||||||
CheckDlgButton(hDlg, IDC_WIDESCREEN_HACK, g_Config.bWidescreenHack ? TRUE : FALSE);
|
CheckDlgButton(hDlg, IDC_WIDESCREEN_HACK, g_Config.bWidescreenHack ? TRUE : FALSE);
|
||||||
CheckDlgButton(hDlg, IDC_SAFE_TEXTURE_CACHE, g_Config.bSafeTextureCache ? TRUE : FALSE);
|
CheckDlgButton(hDlg, IDC_SAFE_TEXTURE_CACHE, g_Config.bSafeTextureCache ? TRUE : FALSE);
|
||||||
CheckDlgButton(hDlg, IDC_EFB_ACCESS_ENABLE, g_Config.bEFBAccessEnable ? TRUE : FALSE);
|
CheckDlgButton(hDlg, IDC_EFB_ACCESS_ENABLE, g_Config.bEFBAccessEnable ? TRUE : FALSE);
|
||||||
|
Button_GetCheck(GetDlgItem(hDlg,IDC_RENDER_TO_MAINWINDOW)) ? Button_Enable(GetDlgItem(hDlg,IDC_FULLSCREENENABLE), false) : Button_Enable(GetDlgItem(hDlg,IDC_FULLSCREENENABLE), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command(HWND hDlg,WPARAM wParam)
|
void Command(HWND hDlg,WPARAM wParam)
|
||||||
@ -142,16 +143,25 @@ struct TabAdvanced : public W32Util::Tab
|
|||||||
//ComboBox_AddString(opt,"Recompile to vbuffers and shaders");
|
//ComboBox_AddString(opt,"Recompile to vbuffers and shaders");
|
||||||
// ComboBox_SetCurSel(opt,g_Config.iCompileDLsLevel);
|
// ComboBox_SetCurSel(opt,g_Config.iCompileDLsLevel);
|
||||||
|
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS), g_Config.bShowFPS);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS), g_Config.bOverlayStats);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS), g_Config.bOverlayStats);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS), g_Config.bOverlayProjStats);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS), g_Config.bOverlayProjStats);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES), g_Config.bDumpFrames);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES), g_Config.bDumpFrames);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG), g_Config.bDisableFog);
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY), !g_Config.bEFBCopyDisable);
|
||||||
|
if(g_Config.bCopyEFBToRAM)
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTORAM), TRUE);
|
||||||
|
else
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTOTEX), TRUE);
|
||||||
|
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter);
|
||||||
Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
||||||
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false);
|
||||||
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
|
||||||
}
|
}
|
||||||
void Command(HWND hDlg,WPARAM wParam)
|
void Command(HWND hDlg,WPARAM wParam)
|
||||||
{
|
{
|
||||||
@ -163,6 +173,12 @@ struct TabAdvanced : public W32Util::Tab
|
|||||||
// SetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),path.c_str());
|
// SetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),path.c_str());
|
||||||
// }
|
// }
|
||||||
// break;
|
// break;
|
||||||
|
case IDC_ENABLEEFBCOPY:
|
||||||
|
{
|
||||||
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false);
|
||||||
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case IDC_TEXFMT_OVERLAY:
|
case IDC_TEXFMT_OVERLAY:
|
||||||
{
|
{
|
||||||
Button_GetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
Button_GetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
||||||
@ -177,19 +193,24 @@ struct TabAdvanced : public W32Util::Tab
|
|||||||
g_Config.bTexFmtOverlayEnable = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? true : false;
|
g_Config.bTexFmtOverlayEnable = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? true : false;
|
||||||
g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false;
|
g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false;
|
||||||
|
|
||||||
|
g_Config.bShowFPS = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS)) ? true : false;
|
||||||
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
|
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
|
||||||
g_Config.bOverlayProjStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS)) ? true : false;
|
g_Config.bOverlayProjStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS)) ? true : false;
|
||||||
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false;
|
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false;
|
||||||
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false;
|
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false;
|
||||||
g_Config.bDumpFrames = Button_GetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES)) ? true : false;
|
g_Config.bDumpFrames = Button_GetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES)) ? true : false;
|
||||||
g_Config.bShowShaderErrors = Button_GetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS)) ? true : false;
|
g_Config.bShowShaderErrors = Button_GetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS)) ? true : false;
|
||||||
|
g_Config.bDisableFog = Button_GetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG)) ? true : false;
|
||||||
|
g_Config.bEFBCopyDisable = Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? false : true;
|
||||||
|
g_Config.bCopyEFBToRAM = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBTORAM)) ? true : false;
|
||||||
//char temp[MAX_PATH];
|
//char temp[MAX_PATH];
|
||||||
//GetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH), temp, MAX_PATH); <-- Old method
|
//GetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH), temp, MAX_PATH); <-- Old method
|
||||||
//g_Config.texDumpPath = temp;
|
//g_Config.texDumpPath = temp;
|
||||||
g_Config.Save(FULL_CONFIG_DIR "gfx_dx9.ini");
|
g_Config.Save(FULL_CONFIG_DIR "gfx_dx9.ini");
|
||||||
|
|
||||||
if( D3D::dev != NULL )
|
if( D3D::dev != NULL ) {
|
||||||
D3D::dev->SetRenderState( D3DRS_FILLMODE, g_Config.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID );
|
D3D::dev->SetRenderState( D3DRS_FILLMODE, g_Config.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <d3dx9.h>
|
#include <d3dx9.h>
|
||||||
|
#include <strsafe.h>
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "Statistics.h"
|
#include "Statistics.h"
|
||||||
@ -360,6 +361,12 @@ static void EFBTextureToD3DBackBuffer(const EFBRectangle& sourceRc)
|
|||||||
D3D::drawShadedTexQuad(read_texture,&sourcerect,Renderer::GetTargetWidth(),Renderer::GetTargetHeight(),&destinationrect,PixelShaderCache::GetColorCopyProgram(),VertexShaderCache::GetSimpleVertexShader());
|
D3D::drawShadedTexQuad(read_texture,&sourcerect,Renderer::GetTargetWidth(),Renderer::GetTargetHeight(),&destinationrect,PixelShaderCache::GetColorCopyProgram(),VertexShaderCache::GetSimpleVertexShader());
|
||||||
|
|
||||||
// Finish up the current frame, print some stats
|
// Finish up the current frame, print some stats
|
||||||
|
if (g_ActiveConfig.bShowFPS)
|
||||||
|
{
|
||||||
|
char fps[20];
|
||||||
|
StringCchPrintfA(fps, 20, "FPS: %d\n", s_fps);
|
||||||
|
D3D::font.DrawTextScaled(0,30,20,20,0.0f,0xFF00FFFF,fps,false);
|
||||||
|
}
|
||||||
if (g_ActiveConfig.bOverlayStats)
|
if (g_ActiveConfig.bOverlayStats)
|
||||||
{
|
{
|
||||||
Statistics::ToString(st);
|
Statistics::ToString(st);
|
||||||
@ -891,6 +898,18 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
|||||||
|
|
||||||
CheckForResize();
|
CheckForResize();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
// Count FPS.
|
||||||
|
// -------------
|
||||||
|
static int fpscount = 0;
|
||||||
|
static unsigned long lasttime;
|
||||||
|
++fpscount;
|
||||||
|
if (timeGetTime() - lasttime > 1000)
|
||||||
|
{
|
||||||
|
lasttime = timeGetTime();
|
||||||
|
s_fps = fpscount - 1;
|
||||||
|
fpscount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Begin new frame
|
// Begin new frame
|
||||||
// Set default viewport and scissor, for the clear to work correctly
|
// Set default viewport and scissor, for the clear to work correctly
|
||||||
|
@ -195,6 +195,7 @@ namespace W32Util
|
|||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
tab->Command(hDlg,wParam);
|
tab->Command(hDlg,wParam);
|
||||||
|
PropSheet_Changed(GetParent(hDlg), hDlg);
|
||||||
break;
|
break;
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
{
|
{
|
||||||
|
@ -21,22 +21,27 @@
|
|||||||
#define IDC_SAFE_TEXTURE_CACHE 1011
|
#define IDC_SAFE_TEXTURE_CACHE 1011
|
||||||
#define IDC_EFB_ACCESS_ENABLE 1012
|
#define IDC_EFB_ACCESS_ENABLE 1012
|
||||||
#define IDC_WIREFRAME 1013
|
#define IDC_WIREFRAME 1013
|
||||||
#define IDC_OVERLAYSTATS 1014
|
#define IDC_DISABLEFOG 1014
|
||||||
#define IDC_OVERLAYPROJSTATS 1015
|
#define IDC_OVERLAYFPS 1015
|
||||||
#define IDC_TEXDUMP 1016
|
#define IDC_OVERLAYSTATS 1016
|
||||||
#define IDC_DUMPFRAMES 1017
|
#define IDC_OVERLAYPROJSTATS 1017
|
||||||
#define IDC_SHOWSHADERERRORS 1018
|
#define IDC_ENABLEEFBCOPY 1018
|
||||||
#define IDC_TEXFMT_OVERLAY 1019
|
#define IDC_EFBTORAM 1019
|
||||||
#define IDC_TEXFMT_CENTER 1020
|
#define IDC_EFBTOTEX 1020
|
||||||
#define IDC_FORCEFILTERING 1021
|
#define IDC_TEXDUMP 1021
|
||||||
#define IDC_FORCEANISOTROPY 1022
|
#define IDC_DUMPFRAMES 1022
|
||||||
|
#define IDC_SHOWSHADERERRORS 1023
|
||||||
|
#define IDC_TEXFMT_OVERLAY 1024
|
||||||
|
#define IDC_TEXFMT_CENTER 1025
|
||||||
|
#define IDC_FORCEFILTERING 1026
|
||||||
|
#define IDC_FORCEANISOTROPY 1027
|
||||||
|
|
||||||
#define IDC_CHECK1 1023
|
#define IDC_CHECK1 1100
|
||||||
#define IDC_LIST1 1024
|
#define IDC_LIST1 1101
|
||||||
#define IDC_DEBUGSTEP 1025
|
#define IDC_DEBUGSTEP 1102
|
||||||
#define IDC_REGISTERS 1026
|
#define IDC_REGISTERS 1103
|
||||||
#define IDC_ENABLEDEBUGGING 1027
|
#define IDC_ENABLEDEBUGGING 1104
|
||||||
#define IDC_REGISTERSELECT 1028
|
#define IDC_REGISTERSELECT 1105
|
||||||
|
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
@ -28,7 +37,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
|
|
||||||
IDD_SETTINGS DIALOGEX 0, 0, 244, 217
|
IDD_SETTINGS DIALOGEX 0, 0, 244, 217
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
|
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "&Graphics card:",IDC_STATIC,7,9,61,8
|
LTEXT "&Graphics card:",IDC_STATIC,7,9,61,8
|
||||||
@ -66,23 +75,29 @@ BEGIN
|
|||||||
CONTROL "",IDC_REGISTERSELECT,"SysTabControl32",TCS_BUTTONS,80,52,145,13
|
CONTROL "",IDC_REGISTERSELECT,"SysTabControl32",TCS_BUTTONS,80,52,145,13
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ADVANCED DIALOGEX 0, 0, 206, 195
|
IDD_ADVANCED DIALOGEX 0, 0, 244, 214
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
|
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUPBOX "&Settings",IDC_STATIC,7,7,192,81
|
GROUPBOX "&Settings",IDC_STATIC,6,7,228,95
|
||||||
CONTROL "&Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,79,9
|
CONTROL "Overlay FPS",IDC_OVERLAYFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,54,12
|
||||||
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,31,88,9
|
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,18,90,12
|
||||||
CONTROL "Overlay &Projection Statistics",IDC_OVERLAYPROJSTATS,
|
CONTROL "Overlay &Projection Statistics",IDC_OVERLAYPROJSTATS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,42,118,9
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,30,102,12
|
||||||
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
|
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,53,127,9
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,30,114,12
|
||||||
GROUPBOX "&Data dumping",IDC_STATIC,7,91,192,42
|
CONTROL "Enable &Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,48,78,12
|
||||||
CONTROL "Dump &textures",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,104,70,9
|
CONTROL "Disable Fog",IDC_DISABLEFOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,48,66,12
|
||||||
CONTROL "Dump Frames to User/Dump/Frames",IDC_DUMPFRAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,116,138,9
|
GROUPBOX "EFB Copy",IDC_STATIC,12,60,216,36
|
||||||
GROUPBOX "Texture Format Overlay",IDC_STATIC,7,136,192,30
|
CONTROL "Enable",IDC_ENABLEEFBCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,72,42,8
|
||||||
CONTROL "Enable Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,148,74,10
|
CONTROL "To RAM",IDC_EFBTORAM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,24,84,84,10
|
||||||
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,148,82,10
|
CONTROL "To Texture",IDC_EFBTOTEX,"Button",BS_AUTORADIOBUTTON,108,84,84,10
|
||||||
|
GROUPBOX "&Data dumping",IDC_STATIC,6,108,228,36
|
||||||
|
CONTROL "Dump &textures",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,120,70,9
|
||||||
|
CONTROL "Dump Frames to User/Dump/Frames",IDC_DUMPFRAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,132,138,9
|
||||||
|
GROUPBOX "Texture Format Overlay",IDC_STATIC,6,150,228,30
|
||||||
|
CONTROL "Enable Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,162,74,10
|
||||||
|
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,162,82,10
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ENHANCEMENTS DIALOGEX 0, 0, 224, 175
|
IDD_ENHANCEMENTS DIALOGEX 0, 0, 224, 175
|
||||||
@ -136,12 +151,12 @@ BEGIN
|
|||||||
IDD_ADVANCED, DIALOG
|
IDD_ADVANCED, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 199
|
RIGHTMARGIN, 237
|
||||||
VERTGUIDE, 14
|
VERTGUIDE, 14
|
||||||
VERTGUIDE, 110
|
VERTGUIDE, 110
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 168
|
BOTTOMMARGIN, 187
|
||||||
HORZGUIDE, 150
|
HORZGUIDE, 168
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ENHANCEMENTS, DIALOG
|
IDD_ENHANCEMENTS, DIALOG
|
||||||
@ -170,13 +185,12 @@ END
|
|||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\0"
|
"#include <windows.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"#include <windows.h\0"
|
||||||
"\0"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
@ -191,8 +205,7 @@ END
|
|||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ static Common::CriticalSection s_criticalScreenshot;
|
|||||||
static std::string s_sScreenshotName;
|
static std::string s_sScreenshotName;
|
||||||
|
|
||||||
int frameCount;
|
int frameCount;
|
||||||
static int s_fps = 0;
|
|
||||||
|
|
||||||
// The custom resolution
|
// The custom resolution
|
||||||
// TODO: Add functionality to reinit all the render targets when the window is resized.
|
// TODO: Add functionality to reinit all the render targets when the window is resized.
|
||||||
|
@ -273,6 +273,7 @@ void Config::Load(bool ChangePad)
|
|||||||
sprintf(SectionName, "Wiimote%i", i + 1);
|
sprintf(SectionName, "Wiimote%i", i + 1);
|
||||||
iniFile.Get(SectionName, "NoTriggerFilter", &bNoTriggerFilter, false);
|
iniFile.Get(SectionName, "NoTriggerFilter", &bNoTriggerFilter, false);
|
||||||
iniFile.Get(SectionName, "TriggerType", &Trigger.Type, Trigger.TRIGGER_OFF);
|
iniFile.Get(SectionName, "TriggerType", &Trigger.Type, Trigger.TRIGGER_OFF);
|
||||||
|
iniFile.Get(SectionName, "TriggerUpright", &Trigger.Upright, false);
|
||||||
iniFile.Get(SectionName, "TriggerRollRange", &Trigger.Range.Roll, 50);
|
iniFile.Get(SectionName, "TriggerRollRange", &Trigger.Range.Roll, 50);
|
||||||
iniFile.Get(SectionName, "TriggerPitchRange", &Trigger.Range.Pitch, false);
|
iniFile.Get(SectionName, "TriggerPitchRange", &Trigger.Range.Pitch, false);
|
||||||
|
|
||||||
@ -375,6 +376,7 @@ void Config::Save(int Slot)
|
|||||||
iniFile.Set(SectionName, "Enabled", WiiMoteEmu::PadMapping[i].enabled);
|
iniFile.Set(SectionName, "Enabled", WiiMoteEmu::PadMapping[i].enabled);
|
||||||
iniFile.Set(SectionName, "NoTriggerFilter", bNoTriggerFilter);
|
iniFile.Set(SectionName, "NoTriggerFilter", bNoTriggerFilter);
|
||||||
iniFile.Set(SectionName, "TriggerType", Trigger.Type);
|
iniFile.Set(SectionName, "TriggerType", Trigger.Type);
|
||||||
|
iniFile.Set(SectionName, "TriggerUpright", Trigger.Upright);
|
||||||
iniFile.Set(SectionName, "TriggerRollRange", Trigger.Range.Roll);
|
iniFile.Set(SectionName, "TriggerRollRange", Trigger.Range.Roll);
|
||||||
iniFile.Set(SectionName, "TriggerPitchRange", Trigger.Range.Pitch);
|
iniFile.Set(SectionName, "TriggerPitchRange", Trigger.Range.Pitch);
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ struct Config
|
|||||||
TRIGGER
|
TRIGGER
|
||||||
};
|
};
|
||||||
int Type;
|
int Type;
|
||||||
|
bool Upright;
|
||||||
PadRange Range;
|
PadRange Range;
|
||||||
};
|
};
|
||||||
struct PadNunchuck
|
struct PadNunchuck
|
||||||
|
@ -34,6 +34,7 @@ BEGIN_EVENT_TABLE(WiimoteBasicConfigDialog,wxDialog)
|
|||||||
EVT_CHECKBOX(ID_CONNECT_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
EVT_CHECKBOX(ID_CONNECT_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_USE_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
EVT_CHECKBOX(ID_USE_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_SIDEWAYSDPAD, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
EVT_CHECKBOX(ID_SIDEWAYSDPAD, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
|
EVT_CHECKBOX(ID_UPRIGHTWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
EVT_CHECKBOX(ID_MOTIONPLUSCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
EVT_CHECKBOX(ID_MOTIONPLUSCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
EVT_CHOICE(ID_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
EVT_CHOICE(ID_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
|
||||||
// IR cursor
|
// IR cursor
|
||||||
@ -207,9 +208,9 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
|
|||||||
// Emulated Wiimote
|
// Emulated Wiimote
|
||||||
m_SidewaysDPad[i] = new wxCheckBox(m_Controller[i], ID_SIDEWAYSDPAD, wxT("Sideways D-Pad"));
|
m_SidewaysDPad[i] = new wxCheckBox(m_Controller[i], ID_SIDEWAYSDPAD, wxT("Sideways D-Pad"));
|
||||||
m_SidewaysDPad[i]->SetValue(g_Config.bSidewaysDPad);
|
m_SidewaysDPad[i]->SetValue(g_Config.bSidewaysDPad);
|
||||||
|
m_UprightWiimote[i] = new wxCheckBox(m_Controller[i], ID_UPRIGHTWIIMOTE, wxT("Upright Wiimote"));
|
||||||
m_SizeEmu[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Wiimote"));
|
m_UprightWiimote[i]->SetValue(g_Config.Trigger.Upright);
|
||||||
m_SizeEmu[i]->Add(m_SidewaysDPad[i], 0, wxEXPAND | wxALL, 5);
|
m_UprightWiimote[i]->SetToolTip(wxT("Treat the upright position as neutral for roll and pitch"));
|
||||||
|
|
||||||
//IR Pointer
|
//IR Pointer
|
||||||
m_TextScreenWidth[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Width: 000"));
|
m_TextScreenWidth[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Width: 000"));
|
||||||
@ -251,6 +252,12 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
|
|||||||
m_CheckAR169[i]->Enable(false);
|
m_CheckAR169[i]->Enable(false);
|
||||||
m_Crop[i]->Enable(false);
|
m_Crop[i]->Enable(false);
|
||||||
|
|
||||||
|
// Sizers
|
||||||
|
|
||||||
|
m_SizeEmu[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Wiimote"));
|
||||||
|
m_SizeEmu[i]->Add(m_SidewaysDPad[i], 0, wxEXPAND | wxALL, 5);
|
||||||
|
m_SizeEmu[i]->Add(m_UprightWiimote[i], 0, wxEXPAND | (wxLEFT | wxDOWN | wxRIGHT), 5);
|
||||||
|
|
||||||
m_SizerIRPointerScreen[i] = new wxBoxSizer(wxHORIZONTAL);
|
m_SizerIRPointerScreen[i] = new wxBoxSizer(wxHORIZONTAL);
|
||||||
m_SizerIRPointerScreen[i]->Add(m_TextAR[i], 0, wxEXPAND | (wxTOP), 0);
|
m_SizerIRPointerScreen[i]->Add(m_TextAR[i], 0, wxEXPAND | (wxTOP), 0);
|
||||||
m_SizerIRPointerScreen[i]->Add(m_CheckAR43[i], 0, wxEXPAND | (wxLEFT), 5);
|
m_SizerIRPointerScreen[i]->Add(m_CheckAR43[i], 0, wxEXPAND | (wxLEFT), 5);
|
||||||
@ -391,6 +398,9 @@ void WiimoteBasicConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
|||||||
|
|
||||||
case ID_SIDEWAYSDPAD:
|
case ID_SIDEWAYSDPAD:
|
||||||
g_Config.bSidewaysDPad = m_SidewaysDPad[Page]->IsChecked();
|
g_Config.bSidewaysDPad = m_SidewaysDPad[Page]->IsChecked();
|
||||||
|
break;
|
||||||
|
case ID_UPRIGHTWIIMOTE:
|
||||||
|
g_Config.Trigger.Upright = m_UprightWiimote[Page]->IsChecked();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MOTIONPLUSCONNECTED:
|
case ID_MOTIONPLUSCONNECTED:
|
||||||
|
@ -79,6 +79,7 @@ class WiimoteBasicConfigDialog : public wxDialog
|
|||||||
|
|
||||||
// Emulated Wiimote settings
|
// Emulated Wiimote settings
|
||||||
wxCheckBox *m_SidewaysDPad[4],
|
wxCheckBox *m_SidewaysDPad[4],
|
||||||
|
*m_UprightWiimote[4],
|
||||||
*m_WiimoteOnline[4],
|
*m_WiimoteOnline[4],
|
||||||
*m_WiiMotionPlusConnected[4],
|
*m_WiiMotionPlusConnected[4],
|
||||||
*m_CheckAR43[4],
|
*m_CheckAR43[4],
|
||||||
@ -126,6 +127,7 @@ class WiimoteBasicConfigDialog : public wxDialog
|
|||||||
|
|
||||||
// Emulated Wiimote
|
// Emulated Wiimote
|
||||||
ID_SIDEWAYSDPAD,
|
ID_SIDEWAYSDPAD,
|
||||||
|
ID_UPRIGHTWIIMOTE,
|
||||||
ID_MOTIONPLUSCONNECTED,
|
ID_MOTIONPLUSCONNECTED,
|
||||||
ID_EXTCONNECTED,
|
ID_EXTCONNECTED,
|
||||||
IDC_WIMOTE_ON,
|
IDC_WIMOTE_ON,
|
||||||
|
@ -59,7 +59,7 @@ void TiltTest(u8 x, u8 y, u8 z)
|
|||||||
std::string To = StringFromFormat("%s\nTo: X:%i Y:%i Z:%i Roll:%s Pitch:%s", From.c_str(), x, y, z,
|
std::string To = StringFromFormat("%s\nTo: X:%i Y:%i Z:%i Roll:%s Pitch:%s", From.c_str(), x, y, z,
|
||||||
(_Roll >= 0) ? StringFromFormat(" %03i", (int)_Roll).c_str() : StringFromFormat("%04i", (int)_Roll).c_str(),
|
(_Roll >= 0) ? StringFromFormat(" %03i", (int)_Roll).c_str() : StringFromFormat("%04i", (int)_Roll).c_str(),
|
||||||
(_Pitch >= 0) ? StringFromFormat(" %03i", (int)_Pitch).c_str() : StringFromFormat("%04i", (int)_Pitch).c_str());
|
(_Pitch >= 0) ? StringFromFormat(" %03i", (int)_Pitch).c_str() : StringFromFormat("%04i", (int)_Pitch).c_str());
|
||||||
DEBUG_LOG(WIIMOTE, "%s", To.c_str());
|
NOTICE_LOG(CONSOLE, "\n%s", To.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,14 +100,29 @@ void PitchDegreeToAccelerometer(float _Roll, float _Pitch, u8 &_x, u8 &_y, u8 &_
|
|||||||
// In these cases we can use the simple and accurate formula
|
// In these cases we can use the simple and accurate formula
|
||||||
if(g_Config.Trigger.Range.Pitch == 0)
|
if(g_Config.Trigger.Range.Pitch == 0)
|
||||||
{
|
{
|
||||||
x = sin(_Roll);
|
if (!g_Config.Trigger.Upright)
|
||||||
z = cos(_Roll);
|
{
|
||||||
|
x = sin(_Roll);
|
||||||
|
z = cos(_Roll);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
z = sin(_Roll);
|
||||||
|
y = -cos(_Roll);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (g_Config.Trigger.Range.Roll == 0)
|
else if (g_Config.Trigger.Range.Roll == 0)
|
||||||
{
|
{
|
||||||
|
if (!g_Config.Trigger.Upright)
|
||||||
y = sin(_Pitch);
|
{
|
||||||
z = cos(_Pitch);
|
y = sin(_Pitch);
|
||||||
|
z = cos(_Pitch);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = -sin(_Pitch);
|
||||||
|
y = -cos(_Pitch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -118,16 +133,28 @@ void PitchDegreeToAccelerometer(float _Roll, float _Pitch, u8 &_x, u8 &_y, u8 &_
|
|||||||
and Pitch. But if we select a Z from the smallest of the absolute
|
and Pitch. But if we select a Z from the smallest of the absolute
|
||||||
value of cos(Roll) and cos (Pitch) we get the right values. */
|
value of cos(Roll) and cos (Pitch) we get the right values. */
|
||||||
// ---------
|
// ---------
|
||||||
if (abs(cos(_Roll)) < abs(cos(_Pitch))) z = cos(_Roll); else z = cos(_Pitch);
|
if (!g_Config.Trigger.Upright)
|
||||||
/* I got these from reversing the calculation in
|
{
|
||||||
PitchAccelerometerToDegree() in a math program I don't know if we
|
if (abs(cos(_Roll)) < abs(cos(_Pitch))) z = cos(_Roll); else z = cos(_Pitch);
|
||||||
can derive these from some kind of matrix or something */
|
/* I got these from reversing the calculation in
|
||||||
float x_num = 2 * tanf(0.5f * _Roll) * z;
|
PitchAccelerometerToDegree() in a math program. */
|
||||||
float x_den = pow2f(tanf(0.5f * _Roll)) - 1;
|
float x_num = 2 * tanf(0.5f * _Roll) * z;
|
||||||
x = - (x_num / x_den);
|
float x_den = pow2f(tanf(0.5f * _Roll)) - 1;
|
||||||
float y_num = 2 * tanf(0.5f * _Pitch) * z;
|
x = - (x_num / x_den);
|
||||||
float y_den = pow2f(tanf(0.5f * _Pitch)) - 1;
|
float y_num = 2 * tanf(0.5f * _Pitch) * z;
|
||||||
y = - (y_num / y_den);
|
float y_den = pow2f(tanf(0.5f * _Pitch)) - 1;
|
||||||
|
y = - (y_num / y_den);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (abs(-cos(_Roll)) < abs(-cos(_Pitch))) y = -cos(_Roll); else y = -cos(_Pitch);
|
||||||
|
float z_num = 2 * tanf(0.5f * _Roll) * y;
|
||||||
|
float z_den = pow2f(tanf(0.5f * _Roll)) - 1;
|
||||||
|
z = (z_num / z_den);
|
||||||
|
float x_num = 2 * tanf(0.5f * _Pitch) * y;
|
||||||
|
float x_den = pow2f(tanf(0.5f * _Pitch)) - 1;
|
||||||
|
x = - (x_num / x_den);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multiply with the neutral of z and its g
|
// Multiply with the neutral of z and its g
|
||||||
@ -145,9 +172,18 @@ void PitchDegreeToAccelerometer(float _Roll, float _Pitch, u8 &_x, u8 &_y, u8 &_
|
|||||||
if (ix < 0) ix = 0; if (ix > 255) ix = 255;
|
if (ix < 0) ix = 0; if (ix > 255) ix = 255;
|
||||||
if (iy < 0) iy = 0; if (iy > 255) iy = 255;
|
if (iy < 0) iy = 0; if (iy > 255) iy = 255;
|
||||||
if (iz < 0) iz = 0; if (iz > 255) iz = 255;
|
if (iz < 0) iz = 0; if (iz > 255) iz = 255;
|
||||||
if(g_Config.Trigger.Range.Roll != 0) _x = ix;
|
if (!g_Config.Trigger.Upright)
|
||||||
if(g_Config.Trigger.Range.Pitch != 0) _y = iy;
|
{
|
||||||
_z = iz;
|
if(g_Config.Trigger.Range.Roll != 0) _x = ix;
|
||||||
|
if(g_Config.Trigger.Range.Pitch != 0) _y = iy;
|
||||||
|
_z = iz;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(g_Config.Trigger.Range.Roll != 0) _z = iz;
|
||||||
|
if(g_Config.Trigger.Range.Pitch != 0) _x = ix;
|
||||||
|
_y = iy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accelerometer to roll and pitch angles
|
// Accelerometer to roll and pitch angles
|
||||||
@ -167,17 +203,34 @@ void PitchAccelerometerToDegree(u8 _x, u8 _y, u8 _z, int &_Roll, int &_Pitch, in
|
|||||||
float y = AccelerometerToG((float)_y, (float)g_wm.cal_zero.y, (float)g_wm.cal_g.y);
|
float y = AccelerometerToG((float)_y, (float)g_wm.cal_zero.y, (float)g_wm.cal_g.y);
|
||||||
float z = AccelerometerToG((float)_z, (float)g_wm.cal_zero.z, (float)g_wm.cal_g.z);
|
float z = AccelerometerToG((float)_z, (float)g_wm.cal_zero.z, (float)g_wm.cal_g.z);
|
||||||
|
|
||||||
// If it is over 1g then it is probably accelerating and may not reliable
|
if (!g_Config.Trigger.Upright)
|
||||||
//if (abs(accel->x - ac->cal_zero.x) <= ac->cal_g.x)
|
|
||||||
{
|
{
|
||||||
// Calculate the degree
|
// If it is over 1g then it is probably accelerating and may not reliable
|
||||||
Roll = InputCommon::Rad2Deg(atan2(x, z));
|
//if (abs(accel->x - ac->cal_zero.x) <= ac->cal_g.x)
|
||||||
}
|
{
|
||||||
|
// Calculate the degree
|
||||||
|
Roll = InputCommon::Rad2Deg(atan2(x, z));
|
||||||
|
}
|
||||||
|
|
||||||
//if (abs(_y - g_wm.cal_zero.y) <= g_wm.cal_g.y)
|
//if (abs(_y - g_wm.cal_zero.y) <= g_wm.cal_g.y)
|
||||||
|
{
|
||||||
|
// Calculate the degree
|
||||||
|
Pitch = InputCommon::Rad2Deg(atan2(y, z));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Calculate the degree
|
//if (abs(accel->z - ac->cal_zero.z) <= ac->cal_g.x)
|
||||||
Pitch = InputCommon::Rad2Deg(atan2(y, z));
|
{
|
||||||
|
// Calculate the degree
|
||||||
|
Roll = InputCommon::Rad2Deg(atan2(z, -y));
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (abs(_x - g_wm.cal_zero.x) <= g_wm.cal_g.x)
|
||||||
|
{
|
||||||
|
// Calculate the degree
|
||||||
|
Pitch = InputCommon::Rad2Deg(atan2(-x, -y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_Roll = (int)Roll;
|
_Roll = (int)Roll;
|
||||||
@ -187,9 +240,16 @@ void PitchAccelerometerToDegree(u8 _x, u8 _y, u8 _z, int &_Roll, int &_Pitch, in
|
|||||||
if (x < -1.0) x = -1.0; else if (x > 1.0) x = 1.0;
|
if (x < -1.0) x = -1.0; else if (x > 1.0) x = 1.0;
|
||||||
if (y < -1.0) y = -1.0; else if (y > 1.0) y = 1.0;
|
if (y < -1.0) y = -1.0; else if (y > 1.0) y = 1.0;
|
||||||
if (z < -1.0) z = -1.0; else if (z > 1.0) z = 1.0;
|
if (z < -1.0) z = -1.0; else if (z > 1.0) z = 1.0;
|
||||||
Roll = InputCommon::Rad2Deg(atan2(x, z));
|
if (!g_Config.Trigger.Upright)
|
||||||
Pitch = InputCommon::Rad2Deg(atan2(y, z));
|
{
|
||||||
|
Roll = InputCommon::Rad2Deg(atan2(x, z));
|
||||||
|
Pitch = InputCommon::Rad2Deg(atan2(y, z));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Roll = InputCommon::Rad2Deg(atan2(z, -y));
|
||||||
|
Pitch = InputCommon::Rad2Deg(atan2(-x, -y));
|
||||||
|
}
|
||||||
_RollAdj = (int)Roll;
|
_RollAdj = (int)Roll;
|
||||||
_PitchAdj = (int)Pitch;
|
_PitchAdj = (int)Pitch;
|
||||||
}
|
}
|
||||||
|
@ -758,12 +758,15 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
|||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
// Test the angles to x, y, z values formula by calculating the values back and forth
|
// Test the angles to x, y, z values formula by calculating the values back and forth
|
||||||
// -----------
|
// -----------
|
||||||
/* //Console::ClearScreen();
|
/*
|
||||||
|
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
||||||
|
Console->ClearScreen();
|
||||||
// Show a test of our calculations
|
// Show a test of our calculations
|
||||||
WiiMoteEmu::TiltTest(data[4], data[5], data[6]);
|
WiiMoteEmu::TiltTest(data[4], data[5], data[6]);
|
||||||
u8 x, y, z;
|
u8 x, y, z;
|
||||||
WiiMoteEmu::Tilt(x, y, z);
|
//WiiMoteEmu::Tilt(x, y, z);
|
||||||
WiiMoteEmu::TiltTest(x, y, z);*/
|
//WiiMoteEmu::TiltTest(x, y, z);
|
||||||
|
*/
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
|
Reference in New Issue
Block a user