compiletime warning fixes, possible wxw crashes fixed, disable build of njoy_test until it's more mature.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1502 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2008-12-12 03:38:50 +00:00
parent 835f38c6e0
commit 66536235e6
8 changed files with 84 additions and 116 deletions

View File

@ -46,7 +46,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\LZO"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LOGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -117,7 +117,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LOGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -344,7 +344,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\LZO"
PreprocessorDefinitions="NDEBUG;_LIB;LOGGING;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0"
BufferSecurityCheck="true"
EnableEnhancedInstructionSet="2"
@ -419,7 +419,7 @@
OmitFramePointers="true"
EnableFiberSafeOptimizations="false"
AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\LZO;..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
PreprocessorDefinitions="NDEBUG;_LIB;LOGGING;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
FloatingPointModel="0"

View File

@ -146,8 +146,8 @@ bool BootCore(const std::string& _rFilename)
//wxMessageBox(wxString::Format(": %02x", m_SYSCONF[IPL_AR]));
ini.Get("Core", "EnableProgressiveScan", &bEnableProgressiveScan, (int)m_SYSCONF[IPL_PGS]);
ini.Get("Core", "EnableWideScreen", &bEnableWideScreen, (int)m_SYSCONF[IPL_AR]);
ini.Get("Core", "EnableProgressiveScan", &bEnableProgressiveScan, m_SYSCONF[IPL_PGS] != 0);
ini.Get("Core", "EnableWideScreen", &bEnableWideScreen, m_SYSCONF[IPL_AR] != 0);
m_SYSCONF[IPL_PGS] = bEnableProgressiveScan;
m_SYSCONF[IPL_AR] = bEnableWideScreen;

View File

@ -341,9 +341,6 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
// save the config... dolphin crashes by far to often to save the settings on closing only
SConfig::GetInstance().SaveSettings();
// Update the status bar
main_frame->ModifyStatusBar();
}
void CConfigMain::CloseClick(wxCommandEvent& WXUNUSED (event))

View File

@ -102,7 +102,7 @@ EVT_MENU(IDM_TOGGLE_TOOLBAR, CFrame::OnToggleToolbar)
EVT_MENU(IDM_TOGGLE_STATUSBAR, CFrame::OnToggleStatusbar)
EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT10, CFrame::OnLoadState)
EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT10, CFrame::OnSaveState)
EVT_SIZE(CFrame::MoveIcons)
EVT_SIZE(CFrame::OnResize)
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
END_EVENT_TABLE()
@ -440,15 +440,8 @@ void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
void CFrame::OnStop(wxCommandEvent& WXUNUSED (event))
{
// Ask for confirmation in case the user accidently clicked Stop
int answer = wxMessageBox(wxT("Are you sure you want to stop the current emulation?"),
wxT("Confirm"), wxYES_NO);
if (answer == wxYES && Core::GetState() != Core::CORE_UNINITIALIZED)
{
Core::Stop();
UpdateGUI();
}
Core::Stop();
UpdateGUI();
}
@ -559,6 +552,12 @@ void CFrame::OnLoadState(wxCommandEvent& event)
State_Load(slot);
}
void CFrame::OnResize(wxSizeEvent& event)
{
DoMoveIcons(); // In FrameWiimote.cpp
event.Skip();
}
void CFrame::OnSaveState(wxCommandEvent& event)
{
int id = event.GetId();
@ -579,19 +578,18 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event)
delete toolBar;
SetToolBar(NULL);
}
this->SendSizeEvent();
}
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
{
if (event.IsChecked())
{
m_pStatusBar = CreateStatusBar();
}
m_pStatusBar->Show();
else
{
delete m_pStatusBar;
m_pStatusBar = NULL;
}
m_pStatusBar->Hide();
this->SendSizeEvent();
}
void CFrame::OnKeyDown(wxKeyEvent& event)
@ -618,74 +616,58 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
void CFrame::UpdateGUI()
{
// buttons
bool initialized = Core::GetState() != Core::CORE_UNINITIALIZED;
bool running = Core::GetState() == Core::CORE_RUN;
bool paused = Core::GetState() == Core::CORE_PAUSE;
if (GetToolBar() != NULL)
{
if (Core::GetState() == Core::CORE_UNINITIALIZED)
{
GetToolBar()->EnableTool(IDM_CONFIG_MAIN, true);
m_pPluginOptions->Enable(true);
GetToolBar()->EnableTool(IDM_STOP, false);
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));
m_pMenuItemPlay->SetText(_T("&Play"));
m_pMenuItemStop->Enable(false);
m_pMenuItemLoad->Enable(false);
m_pMenuItemSave->Enable(false);
}
else
{
GetToolBar()->EnableTool(IDM_CONFIG_MAIN, false);
m_pPluginOptions->Enable(false);
GetToolBar()->EnableTool(IDM_STOP, true);
m_pMenuItemStop->Enable(true);
m_pMenuItemLoad->Enable(true);
m_pMenuItemSave->Enable(true);
if (Core::GetState() == Core::CORE_RUN)
{
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
m_pToolPlay->SetShortHelp(_T("Pause"));
m_pToolPlay->SetLabel(_T("Pause"));
m_pMenuItemPlay->SetText(_T("&Pause"));
}
else
{
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));
m_pMenuItemPlay->SetText(_T("&Play"));
}
}
GetToolBar()->Realize();
GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
GetToolBar()->EnableTool(IDM_STOP, running || paused);
}
// gamelistctrl
m_pMenuItemStop->Enable(running || paused);
m_pMenuItemLoad->Enable(initialized);
m_pMenuItemSave->Enable(initialized);
m_pPluginOptions->Enable(!running && !paused);
if (running)
{
if (Core::GetState() == Core::CORE_UNINITIALIZED)
if (GetToolBar() != NULL)
{
if (m_GameListCtrl && !m_GameListCtrl->IsShown())
{
m_GameListCtrl->Enable();
m_GameListCtrl->Show();
sizerPanel->FitInside(m_Panel);
}
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
m_pToolPlay->SetShortHelp(_("Pause"));
m_pToolPlay->SetLabel(_("Pause"));
}
else
m_pMenuItemPlay->SetText(_("&Pause"));
}
else
{
if (GetToolBar() != NULL)
{
if (m_GameListCtrl && m_GameListCtrl->IsShown())
{
m_GameListCtrl->Disable();
m_GameListCtrl->Hide();
}
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_("Play"));
m_pToolPlay->SetLabel(_("Play"));
}
m_pMenuItemPlay->SetText(_("&Play"));
}
if (GetToolBar() != NULL) GetToolBar()->Realize();
if (!initialized)
{
if (m_GameListCtrl && !m_GameListCtrl->IsShown())
{
m_GameListCtrl->Enable();
m_GameListCtrl->Show();
sizerPanel->FitInside(m_Panel);
}
}
else
{
if (m_GameListCtrl && m_GameListCtrl->IsShown())
{
m_GameListCtrl->Disable();
m_GameListCtrl->Hide();
}
}
}

View File

@ -30,7 +30,7 @@ class CFrame : public wxFrame
void UpdateLeds(); void UpdateSpeakers();
wxBitmap CreateBitmapForLeds(bool On);
wxBitmap CreateBitmapForSpeakers(int BitmapType, bool On);
void MoveIcons(wxSizeEvent& event); void DoMoveIcons(); void MoveLeds(); void MoveSpeakers();
void DoMoveIcons(); void MoveLeds(); void MoveSpeakers();
bool HaveLeds; bool HaveSpeakers;
wxStaticBitmap *m_StatBmp[7];
@ -102,6 +102,7 @@ class CFrame : public wxFrame
void OnToggleDualCore(wxCommandEvent& event);
void OnToggleSkipIdle(wxCommandEvent& event);
void OnToggleThrottle(wxCommandEvent& event);
void OnResize(wxSizeEvent& event);
void OnToggleToolbar(wxCommandEvent& event);
void OnToggleStatusbar(wxCommandEvent& event);
void OnKeyDown(wxKeyEvent& event);

View File

@ -44,7 +44,7 @@ namespace WiimoteLeds
int SPEAKER_SIZE_X = 8;
int SPEAKER_SIZE_Y = 8;
int ConnectionStatusWidth = 103; // This needs to be wider, for vista at least
int ConnectionStatusWidth = 103; // These widths need to be revised, for vista at least
int ConnectionStatusOnlyAdj = 7;
int RightmostMargin = 6;
int SpIconMargin = 11;
@ -105,9 +105,9 @@ void CFrame::ModifyStatusBar()
{ LedsOn = false; SpeakersOn = false; }
// Declarations
int Fields;
int *Widths;
int *StylesFields;
int Fields = 0;
int *Widths = 0;
int *StylesFields = 0;
// ---------------------------------------
// Leds only
@ -227,7 +227,7 @@ void CFrame::CreateLeds()
for(int i = 0; i < 4; i++)
{
m_StatBmp[i] = new wxStaticBitmap(m_pStatusBar, wxID_ANY,
CreateBitmapForLeds((bool)g_Leds[i]));
CreateBitmapForLeds(g_Leds[i] == 1));
}
}
// Update leds
@ -235,7 +235,7 @@ void CFrame::UpdateLeds()
{
for(int i = 0; i < 4; i++)
{
m_StatBmp[i]->SetBitmap(CreateBitmapForLeds((bool)g_Leds[i]));
m_StatBmp[i]->SetBitmap(CreateBitmapForLeds(g_Leds[i] != 0));
}
}
// ==============
@ -252,7 +252,7 @@ void CFrame::CreateSpeakers()
for(int i = 0; i < 3; i++)
{
m_StatBmp[i+4] = new wxStaticBitmap(m_pStatusBar, wxID_ANY,
CreateBitmapForSpeakers(i, (bool)g_Speakers[i]));
CreateBitmapForSpeakers(i, g_Speakers[i] != 0));
}
}
// Update icons
@ -265,7 +265,7 @@ void CFrame::UpdateSpeakers()
{ PanicAlert("Not Wii");}*/
for(int i = 0; i < 3; i++)
{
m_StatBmp[i+4]->SetBitmap(CreateBitmapForSpeakers(i, (bool)g_Speakers[i]));
m_StatBmp[i+4]->SetBitmap(CreateBitmapForSpeakers(i, g_Speakers[i] != 0));
}
}
// ==============
@ -348,12 +348,6 @@ wxBitmap CFrame::CreateBitmapForSpeakers(int BitmapType, bool On)
// =======================================================
// Move the bitmaps
// -------------
void CFrame::MoveIcons(wxSizeEvent& event)
{
DoMoveIcons();
event.Skip();
}
void CFrame::DoMoveIcons()
{
if(HaveLeds) MoveLeds();

View File

@ -370,23 +370,17 @@ Global
{C6CC7A52-0FDD-433A-B2CF-9C6F187DA807}.Release|x64.ActiveCfg = Release|x64
{C6CC7A52-0FDD-433A-B2CF-9C6F187DA807}.Release|x64.Build.0 = Release|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Debug|Win32.ActiveCfg = Debug|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Debug|Win32.Build.0 = Debug|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Debug|x64.ActiveCfg = Debug|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Debug|x64.Build.0 = Debug|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.DebugFast|Win32.Build.0 = DebugFast|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.DebugFast|x64.ActiveCfg = DebugFast|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.DebugFast|x64.Build.0 = DebugFast|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Release|Win32.ActiveCfg = Release|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Release|Win32.Build.0 = Release|Win32
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Release|x64.ActiveCfg = Release|x64
{ADF64291-57ED-4B7A-AB76-37B4A991504B}.Release|x64.Build.0 = Release|x64
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.Debug|Win32.ActiveCfg = Debug|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.Debug|Win32.Build.0 = Debug|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.Debug|x64.ActiveCfg = Debug|x64
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.Debug|x64.Build.0 = Debug|x64
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|Win32.ActiveCfg = Debug|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|Win32.Build.0 = Debug|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|Win32.Build.0 = DebugFast|Win32
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|x64.ActiveCfg = DebugFast|x64
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.DebugFast|x64.Build.0 = DebugFast|x64
{71B16F46-0B00-4EDA-B253-D6D9D03A215C}.Release|Win32.ActiveCfg = Release|Win32

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="Plugin_Wiimote"
ProjectGUID="{8D612734-FAA5-4B8A-804F-4DEA2367D495}"
RootNamespace="Plugin_Wiimote"
@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\include;..\..\Core\Common\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\WiiUse\inc"
PreprocessorDefinitions="LOGGING;WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -129,7 +129,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\include;..\..\Core\Common\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\WiiUse\inc"
PreprocessorDefinitions="LOGGING;WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -377,7 +377,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\include;..\..\Core\Common\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\WiiUse\inc"
PreprocessorDefinitions="LOGGING;DEBUGFAST;WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
PreprocessorDefinitions="DEBUGFAST;WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;_SECURE_SCL=0"
RuntimeLibrary="0"
WarningLevel="3"
WarnAsError="false"
@ -458,7 +458,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\SDL\include;..\..\Core\Common\Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\WiiUse\inc"
PreprocessorDefinitions="LOGGING;WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_WIIMOTE_TEST_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
RuntimeLibrary="0"
WarningLevel="3"
WarnAsError="false"