mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
GUI: Fixed the render-to-main fullscreen mode and screen resizing
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4056 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6b8b576bab
commit
53a8ca52b6
10
Externals/wxWidgets/build/msw/wx_base.vcproj
vendored
10
Externals/wxWidgets/build/msw/wx_base.vcproj
vendored
@ -335,7 +335,7 @@
|
|||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="DebugFast|Win32"
|
Name="DebugFast|Win32"
|
||||||
OutputDirectory="wxBase28_$(PlatformName)\$(ConfigurationName)"
|
OutputDirectory="wxBase28_$(PlatformName)\..\..\..\lib\vc_lib\Win32"
|
||||||
IntermediateDirectory="wxBase28_$(PlatformName)\$(ConfigurationName)"
|
IntermediateDirectory="wxBase28_$(PlatformName)\$(ConfigurationName)"
|
||||||
ConfigurationType="4"
|
ConfigurationType="4"
|
||||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||||
@ -5736,6 +5736,10 @@
|
|||||||
<Filter
|
<Filter
|
||||||
Name="Setup Headers"
|
Name="Setup Headers"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\include\wx\univ\setup.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\wx\msw\setup.h"
|
RelativePath="..\..\include\wx\msw\setup.h"
|
||||||
>
|
>
|
||||||
@ -5800,10 +5804,6 @@
|
|||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\include\wx\univ\setup.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="MSW Headers"
|
Name="MSW Headers"
|
||||||
|
@ -191,7 +191,6 @@ std::string Timer::GetTimeFormatted()
|
|||||||
|
|
||||||
strftime(tmp, 6, "%M:%S", gmTime);
|
strftime(tmp, 6, "%M:%S", gmTime);
|
||||||
|
|
||||||
|
|
||||||
// Now tack on the milliseconds
|
// Now tack on the milliseconds
|
||||||
struct timeb tp;
|
struct timeb tp;
|
||||||
(void)::ftime(&tp);
|
(void)::ftime(&tp);
|
||||||
@ -200,4 +199,29 @@ std::string Timer::GetTimeFormatted()
|
|||||||
return std::string(formattedTime);
|
return std::string(formattedTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Returns a timestamp with decimals for precise time comparisons
|
||||||
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
|
double Timer::GetDoubleTime()
|
||||||
|
{
|
||||||
|
struct timeb tp;
|
||||||
|
(void)::ftime(&tp);
|
||||||
|
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970(); // Get continous timestamp
|
||||||
|
|
||||||
|
/* Remove a few years. We only really want enough seconds to make sure that we are
|
||||||
|
detecting actual actions, perhaps 60 seconds is enough really, but I leave a
|
||||||
|
year of seconds anyway, in case the user's clock is incorrect or something like that */
|
||||||
|
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
||||||
|
|
||||||
|
//if (TmpSeconds < 0) return 0; // Check the the user's clock is working somewhat
|
||||||
|
|
||||||
|
u32 Seconds = (u32)TmpSeconds; // Make a smaller integer that fits in the double
|
||||||
|
double ms = tp.millitm / 1000.0;
|
||||||
|
double TmpTime = Seconds + ms;
|
||||||
|
return TmpTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // Namespace Common
|
} // Namespace Common
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
static void RestoreResolution();
|
static void RestoreResolution();
|
||||||
static u64 GetTimeSinceJan1970();
|
static u64 GetTimeSinceJan1970();
|
||||||
static u64 GetLocalTimeSinceJan1970();
|
static u64 GetLocalTimeSinceJan1970();
|
||||||
|
static double GetDoubleTime();
|
||||||
|
|
||||||
static std::string GetTimeFormatted();
|
static std::string GetTimeFormatted();
|
||||||
std::string GetTimeElapsedFormatted() const;
|
std::string GetTimeElapsedFormatted() const;
|
||||||
|
@ -82,7 +82,7 @@ extern "C" {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/* Windows functions. Setting the cursor with wxSetCursor() did not work in this instance.
|
/* Windows functions. Setting the cursor with wxSetCursor() did not work in this instance.
|
||||||
Probably because it's somehow reset from the WndProc() in the child window */
|
Probably because it's somehow reset from the WndProc() in the child window */
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
@ -113,12 +113,11 @@ HWND MSWGetParent_(HWND Parent)
|
|||||||
return GetParent(Parent);
|
return GetParent(Parent);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/* The CPanel class to receive MSWWindowProc messages from the video plugin. */
|
/* The CPanel class to receive MSWWindowProc messages from the video plugin. */
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
extern CFrame* main_frame;
|
extern CFrame* main_frame;
|
||||||
@ -214,10 +213,10 @@ int abc = 0;
|
|||||||
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
|
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// event tables
|
// event tables
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
@ -297,10 +296,10 @@ EVT_MENU(wxID_ANY, CFrame::PostEvent)
|
|||||||
//EVT_UPDATE_UI(wxID_ANY, CFrame::PostUpdateUIEvent)
|
//EVT_UPDATE_UI(wxID_ANY, CFrame::PostUpdateUIEvent)
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Creation and close, quit functions
|
// Creation and close, quit functions
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
CFrame::CFrame(bool showLogWindow,
|
CFrame::CFrame(bool showLogWindow,
|
||||||
@ -322,6 +321,8 @@ CFrame::CFrame(bool showLogWindow,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// Start debugging mazimized
|
||||||
|
if (UseDebugger) this->Maximize(true);
|
||||||
// Debugger class
|
// Debugger class
|
||||||
if (UseDebugger)
|
if (UseDebugger)
|
||||||
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this);
|
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this);
|
||||||
@ -371,15 +372,15 @@ CFrame::CFrame(bool showLogWindow,
|
|||||||
if (UseDebugger)
|
if (UseDebugger)
|
||||||
{
|
{
|
||||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().
|
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().
|
||||||
Name(wxT("test8")).Caption(wxT("Tree Pane")).
|
Name(wxT("Pane1")).Caption(wxT("Pane1")).
|
||||||
CenterPane().PaneBorder(true));
|
CenterPane().PaneBorder(true));
|
||||||
/**/
|
/**/
|
||||||
m_Mgr->AddPane(m_Panel2, wxAuiPaneInfo().
|
m_Mgr->AddPane(m_Panel2, wxAuiPaneInfo().
|
||||||
Name(wxT("test9")).Caption(wxT("Tree Pane")).
|
Name(wxT("Pane2")).Caption(wxT("Pane2")).
|
||||||
CenterPane());
|
CenterPane());
|
||||||
|
|
||||||
m_Mgr->AddPane(g_pCodeWindow, wxAuiPaneInfo().
|
m_Mgr->AddPane(g_pCodeWindow, wxAuiPaneInfo().
|
||||||
Name(wxT("test10")).Caption(wxT("Tree Pane")).
|
Name(wxT("Pane3")).Caption(wxT("Pane3")).
|
||||||
CenterPane().Right());
|
CenterPane().Right());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -390,22 +391,20 @@ CFrame::CFrame(bool showLogWindow,
|
|||||||
this->SetSizer(sizerFrame);
|
this->SetSizer(sizerFrame);
|
||||||
*/
|
*/
|
||||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().
|
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().
|
||||||
Name(wxT("test8")).Caption(wxT("Tree Pane")).
|
Name(wxT("Pane1")).Caption(wxT("Pane1")).
|
||||||
CenterPane().PaneBorder(false));
|
CenterPane().PaneBorder(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Open log window
|
// Open log window
|
||||||
m_LogWindow = new CLogWindow(this);
|
m_LogWindow = new CLogWindow(this);
|
||||||
if (m_bLogWindow) m_LogWindow->Show();
|
if (m_bLogWindow) m_LogWindow->Show();
|
||||||
|
|
||||||
// Create the toolbar
|
// Create toolbar
|
||||||
RecreateToolbar();
|
RecreateToolbar();
|
||||||
if (!SConfig::GetInstance().m_InterfaceToolbar) TheToolBar->Hide();
|
if (!SConfig::GetInstance().m_InterfaceToolbar) TheToolBar->Hide();
|
||||||
|
|
||||||
FitInside();
|
// Show window
|
||||||
|
Show();
|
||||||
Show(); // Show the window
|
|
||||||
|
|
||||||
// Create list of available plugins for the configuration window
|
// Create list of available plugins for the configuration window
|
||||||
CPluginManager::GetInstance().ScanForPlugins();
|
CPluginManager::GetInstance().ScanForPlugins();
|
||||||
@ -443,6 +442,7 @@ CFrame::CFrame(bool showLogWindow,
|
|||||||
#endif
|
#endif
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
|
// Update controls
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
if (UseDebugger) g_pCodeWindow->UpdateButtonStates();
|
if (UseDebugger) g_pCodeWindow->UpdateButtonStates();
|
||||||
|
|
||||||
@ -482,10 +482,25 @@ void CFrame::OnClose(wxCloseEvent& event)
|
|||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
void CFrame::DoFullscreen(bool _F)
|
||||||
|
{
|
||||||
|
ShowFullScreen(_F);
|
||||||
|
if (_F)
|
||||||
|
{
|
||||||
|
m_Mgr->GetPane(wxT("TBMain")).Hide();
|
||||||
|
m_Mgr->Update();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Mgr->GetPane(wxT("TBMain")).Show();
|
||||||
|
m_Mgr->Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Host messages
|
// Host messages
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -538,10 +553,10 @@ void CFrame::PostUpdateUIEvent(wxUpdateUIEvent& event)
|
|||||||
{
|
{
|
||||||
if (g_pCodeWindow) wxPostEvent(g_pCodeWindow, event);
|
if (g_pCodeWindow) wxPostEvent(g_pCodeWindow, event);
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Input
|
// Input
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||||
@ -582,29 +597,32 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
|||||||
// Escape key turn off fullscreen then Stop emulation in windowed mode
|
// Escape key turn off fullscreen then Stop emulation in windowed mode
|
||||||
if (event.GetKeyCode() == WXK_ESCAPE)
|
if (event.GetKeyCode() == WXK_ESCAPE)
|
||||||
{
|
{
|
||||||
|
// Temporary solution to double esc keydown. When the OpenGL plugin is running all esc keydowns are duplicated
|
||||||
|
// I'm guessing it's coming from the OpenGL plugin but I couldn't find the source of it so I added this until
|
||||||
|
// the source of the problem surfaces.
|
||||||
|
static double Time = 0;
|
||||||
|
if (Common::Timer::GetDoubleTime()-1 < Time) return;
|
||||||
|
Time = Common::Timer::GetDoubleTime();
|
||||||
|
|
||||||
|
DoFullscreen(!IsFullScreen());
|
||||||
if (IsFullScreen())
|
if (IsFullScreen())
|
||||||
{
|
{
|
||||||
ShowFullScreen(false);
|
#ifdef _WIN32
|
||||||
#ifdef _WIN32
|
|
||||||
MSWSetCursor(true);
|
MSWSetCursor(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
//UpdateGUI();
|
||||||
DoStop();
|
|
||||||
|
|
||||||
UpdateGUI();
|
|
||||||
}
|
}
|
||||||
if (event.GetKeyCode() == WXK_RETURN && event.GetModifiers() == wxMOD_ALT)
|
if (event.GetKeyCode() == WXK_RETURN && event.GetModifiers() == wxMOD_ALT)
|
||||||
{
|
{
|
||||||
// For some reasons, wxWidget doesn't proccess the Alt+Enter event there on windows.
|
// For some reasons, wxWidget doesn't proccess the Alt+Enter event there on windows.
|
||||||
// But still, pressing Alt+Enter make it Fullscreen, So this is for other OS... :P
|
// But still, pressing Alt+Enter make it Fullscreen, So this is for other OS... :P
|
||||||
ShowFullScreen(!IsFullScreen());
|
DoFullscreen(!IsFullScreen());
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if(event.GetKeyCode() == 'M', '3', '4', '5', '6') // Send this to the video plugin WndProc
|
if(event.GetKeyCode() == 'M', '3', '4', '5', '6') // Send this to the video plugin WndProc
|
||||||
{
|
{
|
||||||
PostMessage((HWND)Core::GetWindowHandle(), WM_KEYDOWN, event.GetKeyCode(), 0);
|
PostMessage((HWND)Core::GetWindowHandle(), WM_KEYDOWN, event.GetKeyCode(), 0);
|
||||||
event.Skip(); // Don't block the E key
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -630,31 +648,12 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
|
|||||||
CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
|
CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
// Returns a timestamp with decimals for precise time comparisons
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯?
|
|
||||||
double GetDoubleTime()
|
|
||||||
{
|
|
||||||
wxDateTime datetime = wxDateTime::UNow(); // Get timestamp
|
|
||||||
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970(); // Get continous timestamp
|
|
||||||
|
|
||||||
/* Remove a few years. We only really want enough seconds to make sure that we are
|
|
||||||
detecting actual actions, perhaps 60 seconds is enough really, but I leave a
|
|
||||||
year of seconds anyway, in case the user's clock is incorrect or something like that */
|
|
||||||
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
|
||||||
|
|
||||||
//if (TmpSeconds < 0) return 0; // Check the the user's clock is working somewhat
|
|
||||||
|
|
||||||
u32 Seconds = (u32)TmpSeconds; // Make a smaller integer that fits in the double
|
|
||||||
double ms = datetime.GetMillisecond() / 1000.0;
|
|
||||||
double TmpTime = Seconds + ms;
|
|
||||||
return TmpTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Detect double click. Kind of, for some reason we have to manually create the double click for now.
|
// Detect double click. Kind of, for some reason we have to manually create the double click for now.
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯?
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
void CFrame::OnDoubleClick(wxMouseEvent& event)
|
void CFrame::OnDoubleClick(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
// Don't block the mouse click
|
// Don't block the mouse click
|
||||||
@ -667,13 +666,13 @@ void CFrame::OnDoubleClick(wxMouseEvent& event)
|
|||||||
if(Core::GetState() == Core::CORE_UNINITIALIZED || event.GetId() != IDM_MPANEL) return;
|
if(Core::GetState() == Core::CORE_UNINITIALIZED || event.GetId() != IDM_MPANEL) return;
|
||||||
|
|
||||||
// For first click just save the time
|
// For first click just save the time
|
||||||
if(m_fLastClickTime == 0) { m_fLastClickTime = GetDoubleTime(); return; }
|
if(m_fLastClickTime == 0) { m_fLastClickTime = Common::Timer::GetDoubleTime(); return; }
|
||||||
|
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
/* Manually detect double clicks since both wxEVT_LEFT_DCLICK and WM_LBUTTONDBLCLK stops
|
/* Manually detect double clicks since both wxEVT_LEFT_DCLICK and WM_LBUTTONDBLCLK stops
|
||||||
working after the child window is created by the plugin */
|
working after the child window is created by the plugin */
|
||||||
// ----------------------
|
// ----------------------
|
||||||
double TmpTime = GetDoubleTime();
|
double TmpTime = Common::Timer::GetDoubleTime();
|
||||||
int Elapsed = (TmpTime - m_fLastClickTime) * 1000;
|
int Elapsed = (TmpTime - m_fLastClickTime) * 1000;
|
||||||
|
|
||||||
// Get the double click time, if avaliable
|
// Get the double click time, if avaliable
|
||||||
@ -688,7 +687,7 @@ void CFrame::OnDoubleClick(wxMouseEvent& event)
|
|||||||
|
|
||||||
if (Elapsed < DoubleClickTime)
|
if (Elapsed < DoubleClickTime)
|
||||||
{
|
{
|
||||||
ShowFullScreen(!IsFullScreen());
|
DoFullscreen(!IsFullScreen());
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MSWSetCursor(true); // Show the cursor again, in case it was hidden
|
MSWSetCursor(true); // Show the cursor again, in case it was hidden
|
||||||
#endif
|
#endif
|
||||||
@ -700,7 +699,7 @@ void CFrame::OnDoubleClick(wxMouseEvent& event)
|
|||||||
|
|
||||||
|
|
||||||
// Check for mouse motion. Here we process the bHideCursor setting.
|
// Check for mouse motion. Here we process the bHideCursor setting.
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯?
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
void CFrame::OnMotion(wxMouseEvent& event)
|
void CFrame::OnMotion(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@ -723,7 +722,7 @@ void CFrame::OnMotion(wxMouseEvent& event)
|
|||||||
// Update motion for the auto hide option and return
|
// Update motion for the auto hide option and return
|
||||||
if(IsFullScreen() && SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor)
|
if(IsFullScreen() && SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor)
|
||||||
{
|
{
|
||||||
m_iLastMotionTime = GetDoubleTime();
|
m_iLastMotionTime = Common::Timer::GetDoubleTime();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MSWSetCursor(true);
|
MSWSetCursor(true);
|
||||||
#endif
|
#endif
|
||||||
@ -755,7 +754,7 @@ void CFrame::OnMotion(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for mouse status a couple of times per second for the auto hide option
|
// Check for mouse status a couple of times per second for the auto hide option
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯?
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
#if wxUSE_TIMER
|
#if wxUSE_TIMER
|
||||||
void CFrame::Update()
|
void CFrame::Update()
|
||||||
{
|
{
|
||||||
@ -766,7 +765,7 @@ void CFrame::Update()
|
|||||||
if(IsFullScreen())
|
if(IsFullScreen())
|
||||||
{
|
{
|
||||||
int HideDelay = 1; // Wait 1 second to hide the cursor, just like Windows Media Player
|
int HideDelay = 1; // Wait 1 second to hide the cursor, just like Windows Media Player
|
||||||
double TmpSeconds = GetDoubleTime(); // Get timestamp
|
double TmpSeconds = Common::Timer::GetDoubleTime(); // Get timestamp
|
||||||
double CompareTime = TmpSeconds - HideDelay; // Compare it
|
double CompareTime = TmpSeconds - HideDelay; // Compare it
|
||||||
|
|
||||||
if(m_iLastMotionTime < CompareTime) // Update cursor
|
if(m_iLastMotionTime < CompareTime) // Update cursor
|
||||||
@ -778,3 +777,4 @@ void CFrame::Update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@ -217,6 +217,7 @@ class CFrame : public wxFrame
|
|||||||
void GameListChanged(wxCommandEvent& event);
|
void GameListChanged(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnGameListCtrl_ItemActivated(wxListEvent& event);
|
void OnGameListCtrl_ItemActivated(wxListEvent& event);
|
||||||
|
void CFrame::DoFullscreen(bool _F);
|
||||||
|
|
||||||
// MenuBar
|
// MenuBar
|
||||||
// File - Drive
|
// File - Drive
|
||||||
|
@ -280,6 +280,11 @@ void CFrame::PopulateToolbar(wxAuiToolBar* toolBar)
|
|||||||
// Delete and recreate the toolbar
|
// Delete and recreate the toolbar
|
||||||
void CFrame::RecreateToolbar()
|
void CFrame::RecreateToolbar()
|
||||||
{
|
{
|
||||||
|
// Delete toolbar
|
||||||
|
wxToolBarBase* toolBar = GetToolBar();
|
||||||
|
delete toolBar;
|
||||||
|
SetToolBar(NULL);
|
||||||
|
|
||||||
wxAuiToolBar* TheToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
wxAuiToolBar* TheToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
||||||
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT);
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT);
|
||||||
|
|
||||||
@ -288,7 +293,7 @@ void CFrame::RecreateToolbar()
|
|||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
|
|
||||||
m_Mgr->AddPane(TheToolBar, wxAuiPaneInfo().
|
m_Mgr->AddPane(TheToolBar, wxAuiPaneInfo().
|
||||||
Name(wxT("TheToolBar")).Caption(wxT("Big Toolbar")).
|
Name(wxT("TBMain")).Caption(wxT("TBMain")).
|
||||||
ToolbarPane().Top().
|
ToolbarPane().Top().
|
||||||
LeftDockable(false).RightDockable(false));
|
LeftDockable(false).RightDockable(false));
|
||||||
|
|
||||||
@ -300,7 +305,7 @@ void CFrame::RecreateToolbar()
|
|||||||
g_pCodeWindow->PopulateToolbar(TheToolBar2);
|
g_pCodeWindow->PopulateToolbar(TheToolBar2);
|
||||||
|
|
||||||
m_Mgr->AddPane(TheToolBar2, wxAuiPaneInfo().
|
m_Mgr->AddPane(TheToolBar2, wxAuiPaneInfo().
|
||||||
Name(wxT("TheToolBar2")).Caption(wxT("Big Toolbar")).
|
Name(wxT("TBDebug")).Caption(wxT("TBDebug")).
|
||||||
ToolbarPane().Top().
|
ToolbarPane().Top().
|
||||||
LeftDockable(false).RightDockable(false));
|
LeftDockable(false).RightDockable(false));
|
||||||
}
|
}
|
||||||
@ -308,7 +313,6 @@ void CFrame::RecreateToolbar()
|
|||||||
/*
|
/*
|
||||||
wxToolBarBase* toolBar = GetToolBar();
|
wxToolBarBase* toolBar = GetToolBar();
|
||||||
long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE;
|
long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE;
|
||||||
|
|
||||||
delete toolBar;
|
delete toolBar;
|
||||||
SetToolBar(NULL);
|
SetToolBar(NULL);
|
||||||
|
|
||||||
@ -729,7 +733,7 @@ void CFrame::OnLoadWiiMenu(wxCommandEvent& WXUNUSED (event))
|
|||||||
// the entire screen (when we render to the main window).
|
// the entire screen (when we render to the main window).
|
||||||
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
|
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
ShowFullScreen(true);
|
DoFullscreen(true);
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -820,7 +824,9 @@ void CFrame::OnFrameSkip(wxCommandEvent& event)
|
|||||||
|
|
||||||
void CFrame::OnResize(wxSizeEvent& event)
|
void CFrame::OnResize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
FitInside();
|
// fit frame content, not needed right now
|
||||||
|
//FitInside();
|
||||||
|
|
||||||
DoMoveIcons(); // In FrameWiimote.cpp
|
DoMoveIcons(); // In FrameWiimote.cpp
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@ -956,9 +962,8 @@ void CFrame::UpdateGUI()
|
|||||||
GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Play\tF10"));
|
GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Play\tF10"));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (GetToolBar() != NULL)
|
// Commit changes to toolbar
|
||||||
GetToolBar()->Realize();
|
if (GetToolBar() != NULL) GetToolBar()->Realize();
|
||||||
|
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
@ -977,9 +982,6 @@ void CFrame::UpdateGUI()
|
|||||||
m_GameListCtrl->Hide();
|
m_GameListCtrl->Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TheToolBar->Realize();
|
|
||||||
FitInside();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::GameListChanged(wxCommandEvent& event)
|
void CFrame::GameListChanged(wxCommandEvent& event)
|
||||||
|
@ -46,9 +46,16 @@ EndProject
|
|||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dolphin", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dolphin", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
|
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
|
||||||
|
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}
|
||||||
|
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8} = {D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}
|
||||||
|
{8D612734-FAA5-4B8A-804F-4DEA2367D495} = {8D612734-FAA5-4B8A-804F-4DEA2367D495}
|
||||||
|
{9A183B48-ECC2-4121-876A-9B3793686073} = {9A183B48-ECC2-4121-876A-9B3793686073}
|
||||||
|
{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}
|
||||||
{33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF}
|
{33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF}
|
||||||
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
|
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
|
||||||
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
|
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
|
||||||
|
{3D8156A9-64D1-4C8E-ADBE-1B319030E4A4} = {3D8156A9-64D1-4C8E-ADBE-1B319030E4A4}
|
||||||
|
{521498BE-6089-4780-8223-E67C22F4E068} = {521498BE-6089-4780-8223-E67C22F4E068}
|
||||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
|
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
|
||||||
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
|
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
|
||||||
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
|
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
|
||||||
|
@ -492,7 +492,7 @@ void WiimoteRecordingConfigDialog::DoRecordMovement(int _x, int _y, int _z, cons
|
|||||||
Tmp.x = _x;
|
Tmp.x = _x;
|
||||||
Tmp.y = _y;
|
Tmp.y = _y;
|
||||||
Tmp.z = _z;
|
Tmp.z = _z;
|
||||||
Tmp.Time = GetDoubleTime();
|
Tmp.Time = Common::Timer::GetDoubleTime();
|
||||||
memcpy(Tmp.IR, _IR, _IRBytes);
|
memcpy(Tmp.IR, _IR, _IRBytes);
|
||||||
m_vRecording.push_back(Tmp);
|
m_vRecording.push_back(Tmp);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common.h" // Common
|
#include "Common.h" // Common
|
||||||
|
#include "Timer.h"
|
||||||
#include "pluginspecs_wiimote.h"
|
#include "pluginspecs_wiimote.h"
|
||||||
#include "StringUtil.h" // For ArrayToString
|
#include "StringUtil.h" // For ArrayToString
|
||||||
|
|
||||||
@ -147,11 +148,11 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
|||||||
if(g_RecordingCounter[Wm] == 0)
|
if(g_RecordingCounter[Wm] == 0)
|
||||||
{
|
{
|
||||||
INFO_LOG(CONSOLE, "\n\nBegin: %i\n", Wm);
|
INFO_LOG(CONSOLE, "\n\nBegin: %i\n", Wm);
|
||||||
g_RecordingStart[Wm] = GetDoubleTime();
|
g_RecordingStart[Wm] = Common::Timer::GetDoubleTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current time
|
// Get current time
|
||||||
g_RecordingCurrentTime[Wm] = GetDoubleTime() - g_RecordingStart[Wm];
|
g_RecordingCurrentTime[Wm] = Common::Timer::GetDoubleTime() - g_RecordingStart[Wm];
|
||||||
|
|
||||||
// Modify the current time
|
// Modify the current time
|
||||||
g_RecordingCurrentTime[Wm] *= ((25.0 + (double)VRecording.at(g_RecordingPlaying[Wm]).PlaybackSpeed * 25.0) / 100.0);
|
g_RecordingCurrentTime[Wm] *= ((25.0 + (double)VRecording.at(g_RecordingPlaying[Wm]).PlaybackSpeed * 25.0) / 100.0);
|
||||||
|
@ -979,25 +979,6 @@ void InterruptDebugging(bool Emu, const void* _pData)
|
|||||||
of the form seconds.milleseconds for example 1234.123. The leding seconds have no particular meaning
|
of the form seconds.milleseconds for example 1234.123. The leding seconds have no particular meaning
|
||||||
but are just there to enable use to tell if we have entered a new second or now. */
|
but are just there to enable use to tell if we have entered a new second or now. */
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
double GetDoubleTime()
|
|
||||||
{
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
|
||||||
wxDateTime datetime = wxDateTime::UNow(); // Get timestamp
|
|
||||||
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970(); // Get continous timestamp
|
|
||||||
|
|
||||||
/* Remove a few years. We only really want enough seconds to make sure that we are
|
|
||||||
detecting actual actions, perhaps 60 seconds is enough really, but I leave a
|
|
||||||
year of seconds anyway, in case the user's clock is incorrect or something like that */
|
|
||||||
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
|
||||||
|
|
||||||
//if (TmpSeconds < 0) return 0; // Check the the user's clock is working somewhat
|
|
||||||
|
|
||||||
u32 Seconds = (u32)TmpSeconds; // Make a smaller integer that fits in the double
|
|
||||||
double ms = datetime.GetMillisecond() / 1000.0;
|
|
||||||
double TmpTime = Seconds + ms;
|
|
||||||
return TmpTime;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Calculate the current update frequency. Calculate the time between ten updates, and average
|
/* Calculate the current update frequency. Calculate the time between ten updates, and average
|
||||||
five such rates. If we assume there are 60 updates per second if the game is running at full
|
five such rates. If we assume there are 60 updates per second if the game is running at full
|
||||||
@ -1013,9 +994,9 @@ int GetUpdateRate()
|
|||||||
if(g_UpdateTimeList.size() == 5) g_UpdateTimeList.erase(g_UpdateTimeList.begin() + 0);
|
if(g_UpdateTimeList.size() == 5) g_UpdateTimeList.erase(g_UpdateTimeList.begin() + 0);
|
||||||
|
|
||||||
// Calculate the time and save it
|
// Calculate the time and save it
|
||||||
int Time = (int)(10 / (GetDoubleTime() - g_UpdateTime));
|
int Time = (int)(10 / (Common::Timer::GetDoubleTime() - g_UpdateTime));
|
||||||
g_UpdateTimeList.push_back(Time);
|
g_UpdateTimeList.push_back(Time);
|
||||||
//INFO_LOG(CONSOLE, "Time: %i %f\n", Time, GetDoubleTime());
|
//INFO_LOG(CONSOLE, "Time: %i %f\n", Time, Common::Timer::GetDoubleTime());
|
||||||
|
|
||||||
int TotalTime = 0;
|
int TotalTime = 0;
|
||||||
for (int i = 0; i < (int)g_UpdateTimeList.size(); i++)
|
for (int i = 0; i < (int)g_UpdateTimeList.size(); i++)
|
||||||
@ -1023,7 +1004,7 @@ int GetUpdateRate()
|
|||||||
g_UpdateRate = TotalTime / 5;
|
g_UpdateRate = TotalTime / 5;
|
||||||
|
|
||||||
// Write the new update time
|
// Write the new update time
|
||||||
g_UpdateTime = GetDoubleTime();
|
g_UpdateTime = Common::Timer::GetDoubleTime();
|
||||||
|
|
||||||
g_UpdateCounter = 0;
|
g_UpdateCounter = 0;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#endif
|
#endif
|
||||||
// Definitions and declarations
|
// Definitions and declarations
|
||||||
void DoInitialize();
|
void DoInitialize();
|
||||||
double GetDoubleTime();
|
|
||||||
int GetUpdateRate();
|
int GetUpdateRate();
|
||||||
void InterruptDebugging(bool Emu, const void* _pData);
|
void InterruptDebugging(bool Emu, const void* _pData);
|
||||||
void ReadDebugging(bool Emu, const void* _pData, int Size);
|
void ReadDebugging(bool Emu, const void* _pData, int Size);
|
||||||
|
Loading…
Reference in New Issue
Block a user