From d9f367f03f908ce7a2e063de9cf3080aafc3d608 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Mon, 27 Apr 2009 22:00:56 +0000 Subject: [PATCH] wxGui Branch: [Linux] Fixes for various warnings and errors. git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1078 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Types.h | 8 ++++- pcsx2/Config.h | 4 +++ pcsx2/IopHw.cpp | 2 +- pcsx2/NewGUI/{Dialogs => }/AboutBoxDialog.cpp | 0 pcsx2/NewGUI/{Dialogs => }/AboutBoxDialog.h | 0 pcsx2/NewGUI/AppConfig.cpp | 19 +++++++++-- pcsx2/NewGUI/CheckedStaticBox.cpp | 6 ++-- pcsx2/NewGUI/CheckedStaticBox.h | 2 +- .../NewGUI/{Dialogs => }/GameFixesDialog.cpp | 10 ++++-- pcsx2/NewGUI/{Dialogs => }/GameFixesDialog.h | 6 ++-- .../NewGUI/{Dialogs => }/LogOptionsDialog.cpp | 2 +- pcsx2/NewGUI/{Dialogs => }/LogOptionsDialog.h | 0 pcsx2/NewGUI/MainFrame.cpp | 6 ++-- pcsx2/NewGUI/Makefile.am | 6 ++-- pcsx2/NewGUI/main.cpp | 4 +-- pcsx2/Paths.h | 2 +- pcsx2/PrecompiledHeader.h | 1 + pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 33 ++++--------------- 18 files changed, 59 insertions(+), 52 deletions(-) rename pcsx2/NewGUI/{Dialogs => }/AboutBoxDialog.cpp (100%) rename pcsx2/NewGUI/{Dialogs => }/AboutBoxDialog.h (100%) rename pcsx2/NewGUI/{Dialogs => }/GameFixesDialog.cpp (86%) rename pcsx2/NewGUI/{Dialogs => }/GameFixesDialog.h (97%) rename pcsx2/NewGUI/{Dialogs => }/LogOptionsDialog.cpp (95%) rename pcsx2/NewGUI/{Dialogs => }/LogOptionsDialog.h (100%) diff --git a/common/include/Pcsx2Types.h b/common/include/Pcsx2Types.h index 942076e972..ad7f766810 100644 --- a/common/include/Pcsx2Types.h +++ b/common/include/Pcsx2Types.h @@ -55,7 +55,13 @@ typedef s32 sptr; #ifdef HAVE_STDINT_H #include "stdint.h" -typedef int8_t s8; +// note: char and int8_t are not interchangable types on gcc, because int8_t apparently +// maps to 'signed char' which (due to 1's compliment or something) is its own unique +// type. This creates cross-compiler inconsistencies, in addition to being entirely +// unexpected behavior to any sane programmer, so we typecast s8 to char instead. :) + +//typedef int8_t s8; +typedef char s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 664b38ffa1..26a84a2733 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -184,6 +184,10 @@ public: McdSysOptions MemoryCards; public: + void Load(); + void Save(); + +protected: void LoadSave( IniInterface& ini ); }; diff --git a/pcsx2/IopHw.cpp b/pcsx2/IopHw.cpp index 4ff987d7f0..8a992bb1f5 100644 --- a/pcsx2/IopHw.cpp +++ b/pcsx2/IopHw.cpp @@ -618,7 +618,7 @@ u32 psxHwRead32(u32 add) { } // A buffer that stores messages until it gets a /n or the number of chars (g_pbufi) is more then 1023. -s8 g_pbuf[1024]; +char g_pbuf[1024]; int g_pbufi; void psxHwWrite8(u32 add, u8 value) { if (add >= HW_USB_START && add < HW_USB_END) { diff --git a/pcsx2/NewGUI/Dialogs/AboutBoxDialog.cpp b/pcsx2/NewGUI/AboutBoxDialog.cpp similarity index 100% rename from pcsx2/NewGUI/Dialogs/AboutBoxDialog.cpp rename to pcsx2/NewGUI/AboutBoxDialog.cpp diff --git a/pcsx2/NewGUI/Dialogs/AboutBoxDialog.h b/pcsx2/NewGUI/AboutBoxDialog.h similarity index 100% rename from pcsx2/NewGUI/Dialogs/AboutBoxDialog.h rename to pcsx2/NewGUI/AboutBoxDialog.h diff --git a/pcsx2/NewGUI/AppConfig.cpp b/pcsx2/NewGUI/AppConfig.cpp index 587262c4a2..40efdbc2fa 100644 --- a/pcsx2/NewGUI/AppConfig.cpp +++ b/pcsx2/NewGUI/AppConfig.cpp @@ -85,10 +85,10 @@ namespace FilenameDefs return wxGetApp().GetAppName() + wxT(".ini"); } - wxFileName Memcard[2] = + const wxFileName Memcard[2] = { - wxT("Mcd001.ps2"), - wxT("Mcd002.ps2") + wxFileName( wxT("Mcd001.ps2") ), + wxFileName( wxT("Mcd002.ps2") ) }; }; @@ -160,6 +160,19 @@ void AppConfig::LoadSave( IniInterface& ini ) ini.Flush(); } +void AppConfig::Load() +{ + // Note: Extra parenthisis resolves "I think this is a function" issues with C++. + IniLoader loader( (IniLoader()) ); + LoadSave( loader ); +} + +void AppConfig::Save() +{ + IniSaver saver( (IniSaver()) ); + LoadSave( saver ); +} + void AppConfig::ConsoleLogOptions::LoadSave( IniInterface& ini ) { ini.SetPath( wxT("ConsoleLog") ); diff --git a/pcsx2/NewGUI/CheckedStaticBox.cpp b/pcsx2/NewGUI/CheckedStaticBox.cpp index 2b4c2bcbe6..660c04886e 100644 --- a/pcsx2/NewGUI/CheckedStaticBox.cpp +++ b/pcsx2/NewGUI/CheckedStaticBox.cpp @@ -40,6 +40,8 @@ CheckedStaticBox::CheckedStaticBox( wxWindow* parent, int orientation, const wxS // Ensure that the right-side of the static group box isn't too cozy: m_StaticBoxSizer.SetMinSize( ThisToggle.GetSize() + wxSize( 22, 1 ) ); + + Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CheckedStaticBox::MainToggle_Click ) ); } // Adds a checkbox to this group panel's base sizer. @@ -52,9 +54,9 @@ wxCheckBox& CheckedStaticBox::AddCheckBox( const wxString& label, wxWindowID id ////////////////////////////////////////////////////////////////////////////////////////// // -BEGIN_EVENT_TABLE(CheckedStaticBox, wxPanel) +/*BEGIN_EVENT_TABLE(CheckedStaticBox, wxPanel) EVT_CHECKBOX(wxID_ANY, MainToggle_Click) -END_EVENT_TABLE() +END_EVENT_TABLE()*/ void CheckedStaticBox::MainToggle_Click( wxCommandEvent& evt ) { diff --git a/pcsx2/NewGUI/CheckedStaticBox.h b/pcsx2/NewGUI/CheckedStaticBox.h index 1f192974c1..0f29b72ecd 100644 --- a/pcsx2/NewGUI/CheckedStaticBox.h +++ b/pcsx2/NewGUI/CheckedStaticBox.h @@ -38,7 +38,7 @@ public: wxCheckBox& AddCheckBox( const wxString& label, wxWindowID id=wxID_ANY ); protected: - DECLARE_EVENT_TABLE(); + //DECLARE_EVENT_TABLE(); public: // Event handler for click events for the main checkbox (default behavior: enables/disables all child controls) diff --git a/pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp b/pcsx2/NewGUI/GameFixesDialog.cpp similarity index 86% rename from pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp rename to pcsx2/NewGUI/GameFixesDialog.cpp index d7c455226c..0e8c80b334 100644 --- a/pcsx2/NewGUI/Dialogs/GameFixesDialog.cpp +++ b/pcsx2/NewGUI/GameFixesDialog.cpp @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - + #include "PrecompiledHeader.h" #include "Misc.h" #include "GameFixesDialog.h" @@ -43,15 +43,19 @@ GameFixesDialog::GameFixesDialog( wxWindow* parent, int id ): AddOkCancel( mainSizer ); SetSizerAndFit( &mainSizer ); + + Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GameFixesDialog::FPUCompareHack_Click ) ); + Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GameFixesDialog::TriAce_Click ) ); + Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GameFixesDialog::GodWar_Click ) ); } - +/* BEGIN_EVENT_TABLE(GameFixesDialog, wxDialog) EVT_CHECKBOX(wxID_ANY, FPUCompareHack_Click) EVT_CHECKBOX(wxID_ANY, TriAce_Click) EVT_CHECKBOX(wxID_ANY, GodWar_Click) END_EVENT_TABLE(); - +*/ void GameFixesDialog::FPUCompareHack_Click(wxCommandEvent &event) { diff --git a/pcsx2/NewGUI/Dialogs/GameFixesDialog.h b/pcsx2/NewGUI/GameFixesDialog.h similarity index 97% rename from pcsx2/NewGUI/Dialogs/GameFixesDialog.h rename to pcsx2/NewGUI/GameFixesDialog.h index ddd739598e..fc75f21396 100644 --- a/pcsx2/NewGUI/Dialogs/GameFixesDialog.h +++ b/pcsx2/NewGUI/GameFixesDialog.h @@ -17,7 +17,7 @@ */ #pragma once - + #include #include @@ -28,12 +28,10 @@ namespace Dialogs class GameFixesDialog: public wxDialogWithHelpers { public: - GameFixesDialog(wxWindow* parent, int id); protected: - - DECLARE_EVENT_TABLE(); + //DECLARE_EVENT_TABLE(); public: void FPUCompareHack_Click(wxCommandEvent &event); diff --git a/pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp b/pcsx2/NewGUI/LogOptionsDialog.cpp similarity index 95% rename from pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp rename to pcsx2/NewGUI/LogOptionsDialog.cpp index 6308649238..0bee779bcd 100644 --- a/pcsx2/NewGUI/Dialogs/LogOptionsDialog.cpp +++ b/pcsx2/NewGUI/LogOptionsDialog.cpp @@ -90,7 +90,7 @@ LogOptionsDialog::eeLogOptionsPanel::HwPanel::HwPanel( wxWindow* parent ) : void LogOptionsDialog::eeLogOptionsPanel::OnLogChecked(wxCommandEvent &event) { - LogChecks checkId = (LogChecks)(int)event.m_callbackUserData; + //LogChecks checkId = (LogChecks)(int)event.m_callbackUserData; //ToggleLogOption( checkId ); event.Skip(); } diff --git a/pcsx2/NewGUI/Dialogs/LogOptionsDialog.h b/pcsx2/NewGUI/LogOptionsDialog.h similarity index 100% rename from pcsx2/NewGUI/Dialogs/LogOptionsDialog.h rename to pcsx2/NewGUI/LogOptionsDialog.h diff --git a/pcsx2/NewGUI/MainFrame.cpp b/pcsx2/NewGUI/MainFrame.cpp index 09273717c2..23cb640931 100644 --- a/pcsx2/NewGUI/MainFrame.cpp +++ b/pcsx2/NewGUI/MainFrame.cpp @@ -18,9 +18,9 @@ #include "PrecompiledHeader.h" #include "MainFrame.h" -#include "Dialogs/GameFixesDialog.h" -#include "Dialogs/LogOptionsDialog.h" -#include "Dialogs/AboutBoxDialog.h" +#include "GameFixesDialog.h" +#include "LogOptionsDialog.h" +#include "AboutBoxDialog.h" #include "Resources/EmbeddedImage.h" #include "Resources/AppIcon.h" diff --git a/pcsx2/NewGUI/Makefile.am b/pcsx2/NewGUI/Makefile.am index 8503a3579f..433b82a00b 100644 --- a/pcsx2/NewGUI/Makefile.am +++ b/pcsx2/NewGUI/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = foreign -INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../../common/include -I@srcdir@/../../3rdparty $(shell wx-config --cppflags) +INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../Linux/ -I@srcdir@/../../common/include -I@srcdir@/../../3rdparty $(shell wx-config --cppflags) bin_PROGRAMS = pcsx2 @@ -7,8 +7,8 @@ bin_PROGRAMS = pcsx2 pcsx2_SOURCES = \ CheckedStaticBox.cpp ConsoleLogger.cpp MainFrame.cpp wxHelpers.cpp AppConfig.cpp main.cpp \ App.h CheckedStaticBox.h MainFrame.h wxHelpers.h \ -Dialogs/AboutBoxDialog.cpp Dialogs/GameFixesDialog.cpp Dialogs/LogOptionsDialog.cpp \ -Dialogs/AboutBoxDialog.h Dialogs/GameFixesDialog.h Dialogs/LogOptionsDialog.h ../Linux/memzero.h +AboutBoxDialog.cpp GameFixesDialog.cpp LogOptionsDialog.cpp \ +AboutBoxDialog.h GameFixesDialog.h LogOptionsDialog.h pcsx2_LDFLAGS = diff --git a/pcsx2/NewGUI/main.cpp b/pcsx2/NewGUI/main.cpp index 5108eb7cd8..7abce7508a 100644 --- a/pcsx2/NewGUI/main.cpp +++ b/pcsx2/NewGUI/main.cpp @@ -122,7 +122,7 @@ bool Pcsx2App::OnInit() wxConfigBase::Get()->SetRecordDefaults(); } - g_Conf.LoadSave( IniLoader() ); + g_Conf.Load(); m_Bitmap_Logo = new wxBitmap( EmbeddedImage().GetImage() ); @@ -135,7 +135,7 @@ bool Pcsx2App::OnInit() int Pcsx2App::OnExit() { - g_Conf.LoadSave( IniSaver() ); + g_Conf.Save(); return wxApp::OnExit(); } diff --git a/pcsx2/Paths.h b/pcsx2/Paths.h index 2c9c8a4e6c..9cd6b17bec 100644 --- a/pcsx2/Paths.h +++ b/pcsx2/Paths.h @@ -193,7 +193,7 @@ namespace PathDefs namespace FilenameDefs { extern wxFileName GetConfig(); - extern wxFileName Memcard[2]; + extern const wxFileName Memcard[2]; }; #endif diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 1be7332019..e1d98aa940 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -92,6 +92,7 @@ typedef int BOOL; // need a full recompile anyway, when modified (etc) #include "zlib/zlib.h" + #include "PS2Etypes.h" #include "Paths.h" #include "Config.h" diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 38c82aebd2..82212c5d71 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -2907,27 +2907,6 @@ - - - - - - - - -