mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Interface and general: Fixed the hangings and crashes that would occur from repeated Start and Stop, added optional toolbar themes, made the fullscreen mode in the OpenGL plugin more user friendly for Windows users
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1770 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
//#include <tchar.h>
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -36,30 +36,14 @@
|
||||
// Enable or disable logging to screen and file
|
||||
#define MM_DEBUG
|
||||
//#define MM_DEBUG_FILEONLY
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// _T
|
||||
/*
|
||||
#ifdef _UNICODE
|
||||
#define _T(x) L ## x
|
||||
#else // _UNICODE
|
||||
#define _T(x) x
|
||||
#endif // _UNICODE
|
||||
|
||||
To be used with
|
||||
//wprintf(_T("Please enter a number:"));
|
||||
//wprintf("Please enter a number");
|
||||
//wprintf(L"Please enter a number");
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
#ifdef MM_DEBUG
|
||||
FILE* __fStdOut = NULL;
|
||||
#endif
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
HANDLE __hStdOut = NULL;
|
||||
#endif
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
@ -70,7 +54,6 @@ To be used with
|
||||
// Width and height is the size of console window, if you specify fname,
|
||||
// the output will also be writton to this file. The file pointer is automatically closed
|
||||
// when you close the app
|
||||
//void startConsoleWin(int width=80, int height=2225, char* fname = NULL);
|
||||
void StartConsoleWin(int width, int height, char* fname)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
@ -103,10 +86,12 @@ void StartConsoleWin(int width, int height, char* fname)
|
||||
|
||||
#endif
|
||||
}
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
// Use wprintf like TRACE0, TRACE1, ... (The arguments are the same as printf)
|
||||
//int wprintf(char *fmt, ...)
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Printf function
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int wprintf(char *fmt, ...)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
@ -120,14 +105,12 @@ int wprintf(char *fmt, ...)
|
||||
|
||||
DWORD cCharsWritten;
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
if(__hStdOut)
|
||||
{
|
||||
WriteConsole(__hStdOut, s, strlen(s), &cCharsWritten, NULL);
|
||||
}
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
if(__fStdOut)
|
||||
{
|
||||
@ -139,4 +122,5 @@ int wprintf(char *fmt, ...)
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/////////////////////////////
|
@ -28,6 +28,12 @@
|
||||
#include "../../../../Source/Core/DolphinWX/Src/Globals.h" // DolphinWX
|
||||
#include "../../../../Source/Core/DolphinWX/Src/Frame.h"
|
||||
|
||||
#include "../../../../Source/Core/DolphinWX/resources/toolbar_plugin_dsp.c" // Icons
|
||||
#include "../../../../Source/Core/DolphinWX/resources/Boomy.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/Vista.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/KDE.h"
|
||||
#include "../../../../Source/Core/DolphinWX/resources/X-Plastik.h"
|
||||
|
||||
#include "../../Common/Src/Console.h" // Local
|
||||
#include "../../Player/Src/PlayerExport.h" // Player
|
||||
//////////////////////////////////
|
||||
@ -127,15 +133,33 @@ void ShowConsole()
|
||||
|
||||
#ifdef MUSICMOD
|
||||
void
|
||||
CFrame::MM_InitBitmaps()
|
||||
CFrame::MM_InitBitmaps(int Theme)
|
||||
{
|
||||
// Gray version
|
||||
// Define the log bitmaps
|
||||
switch (Theme)
|
||||
{
|
||||
case BOOMY:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log_png);
|
||||
break;
|
||||
case VISTA:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log1_png);
|
||||
break;
|
||||
case XPLASTIK:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log2_png);
|
||||
break;
|
||||
case KDE:
|
||||
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log3_png);
|
||||
break;
|
||||
default: PanicAlert("Theme selection went wrong");
|
||||
}
|
||||
|
||||
//m_Bitmaps[Toolbar_PluginDSP_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_PluginDSP], 165, true));
|
||||
// Create a gray version
|
||||
m_Bitmaps[Toolbar_PluginDSP_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_PluginDSP], 165, true));
|
||||
m_Bitmaps[Toolbar_Log_Dis] = wxBitmap(SetBrightness(m_Bitmaps[Toolbar_Log], 165, true));
|
||||
}
|
||||
|
||||
// Update in case the bitmap has been updated
|
||||
//if (GetToolBar() != NULL) TheToolBar->FindById(Toolbar_Log)->SetNormalBitmap(m_Bitmaps[Toolbar_Log]);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@ -164,7 +188,7 @@ CFrame::MM_PopulateGUI()
|
||||
// -----------
|
||||
|
||||
|
||||
wxToolBar* toolBar = theToolBar; // Shortcut
|
||||
wxToolBar* toolBar = TheToolBar; // Shortcut
|
||||
|
||||
toolBar->AddSeparator();
|
||||
|
||||
@ -195,7 +219,7 @@ CFrame::MM_PopulateGUI()
|
||||
|
||||
|
||||
|
||||
mm_ToolMute = toolBar->AddTool(IDM_MUTE, _T("Mute"), m_Bitmaps[Toolbar_Play], _T("Mute music"));
|
||||
mm_ToolMute = toolBar->AddTool(IDM_MUTE, _T("Mute"), m_Bitmaps[Toolbar_PluginDSP], _T("Mute music"));
|
||||
mm_ToolPlay = toolBar->AddTool(IDM_MUSIC_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play or pause music without pausing the game"));
|
||||
|
||||
// This cause the disabled tool bitmap to become some kind of monochrome version
|
||||
@ -232,34 +256,30 @@ CFrame::MM_PopulateGUI()
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Update GUI
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void
|
||||
CFrame::MM_UpdateGUI()
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
if(MusicMod::GlobalMute)
|
||||
{
|
||||
//m_pMenuItemMute->SetText(_T("Play"));
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_MUTE, m_Bitmaps[Toolbar_Pause]);
|
||||
mm_ToolMute->SetLabel("Unmute");
|
||||
mm_ToolMute->SetNormalBitmap(m_Bitmaps[Toolbar_PluginDSP_Dis]);
|
||||
//m_ToolMute->SetToggle(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_MUTE, m_Bitmaps[Toolbar_PluginDSP]);
|
||||
mm_ToolMute->SetLabel("Mute");
|
||||
mm_ToolMute->SetNormalBitmap(m_Bitmaps[Toolbar_PluginDSP]);
|
||||
}
|
||||
|
||||
if(MusicMod::GlobalPause)
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_PAUSE, m_Bitmaps[Toolbar_Pause]);
|
||||
mm_ToolPlay->SetLabel("Play");
|
||||
mm_ToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
|
||||
}
|
||||
else
|
||||
{
|
||||
//GetToolBar()->SetToolNormalBitmap(IDM_PAUSE, m_Bitmaps[Toolbar_PluginDSP]);
|
||||
mm_ToolPlay->SetLabel("Pause");
|
||||
mm_ToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
|
||||
}
|
||||
@ -272,9 +292,8 @@ CFrame::MM_UpdateGUI()
|
||||
{
|
||||
mm_ToolLog->SetNormalBitmap(m_Bitmaps[Toolbar_Log_Dis]);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
|
||||
@ -435,7 +454,7 @@ void CFrame::MM_OnLog(wxCommandEvent& event)
|
||||
MusicMod::bShowConsole = !MusicMod::bShowConsole;
|
||||
|
||||
if(MusicMod::bShowConsole)
|
||||
{ ShowConsole(); Player_Console(true); }
|
||||
{ ShowConsole(); /*Player_Console(true);*/ }
|
||||
else
|
||||
{
|
||||
#if defined (_WIN32)
|
||||
|
@ -109,11 +109,9 @@ ConfBool cbLoop( &bLoop, TEXT( "Loop" ), CONF_MODE_PUBLIC, false );
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The first function that is called by the exe
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow )
|
||||
void Player_Main(bool Console)
|
||||
{
|
||||
// =======================================================================================
|
||||
|
@ -146,8 +146,7 @@ void Player_Volume(int a)
|
||||
|
||||
void ShowConsole()
|
||||
{
|
||||
//startConsoleWin(130, 10000, "Console Window"); // give room for 2000 rows
|
||||
StartConsoleWin(100, 2000, "ConsoleDLL"); // give room for 2000 rows
|
||||
StartConsoleWin(100, 2000, "MusicMod"); // give room for 2000 rows
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user