diff --git a/SConstruct b/SConstruct index b94a36a0d4..f10463abb7 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,6 @@ import os -ccflags = '-g -O3 -fno-strict-aliasing -fPIC -m64 -msse2 -Wall -DLOGGING -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' +ccflags = '-g -O3 -fno-strict-aliasing -fPIC -msse2 -Wall -DLOGGING -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' if False: ccflags += ' -fomit-frame-pointer' @@ -32,8 +32,8 @@ dirs = ["Source/Core/Common/Src", lib_paths = include_paths -env = Environment(CC="gcc-4.3", - CXX="g++-4.3", +env = Environment(CC="gcc", + CXX="g++", CCFLAGS=ccflags, CXXFLAGS=ccflags, CPPPATH=include_paths, diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp index 4455f99004..11a87d524c 100644 --- a/Source/Core/Common/Src/MemArena.cpp +++ b/Source/Core/Common/Src/MemArena.cpp @@ -64,8 +64,11 @@ void* MemArena::CreateView(s64 offset, size_t size, bool ensure_low_mem) #else void* ptr = mmap(0, size, PROT_READ | PROT_WRITE, - MAP_SHARED | (ensure_low_mem ? MAP_32BIT : 0), - fd, offset); + MAP_SHARED +#ifdef __x86_64__ + | (ensure_low_mem ? MAP_32BIT : 0) +#endif + , fd, offset); if (!ptr) { diff --git a/Source/Core/Common/Src/SConscript b/Source/Core/Common/Src/SConscript index 5974faabff..d14efd2c5d 100644 --- a/Source/Core/Common/Src/SConscript +++ b/Source/Core/Common/Src/SConscript @@ -21,6 +21,7 @@ files = ["Common.cpp", "x64Emitter.cpp", "x64Analyzer.cpp", ] - -env_common = env.Copy(CXXFLAGS = " -fPIC ") + +env_common = env.Copy() +env_common.Append(CXXFLAGS = " -fPIC ") env_common.StaticLibrary("common", files) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.cpp index bb72966ccf..a260fd23b2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.cpp @@ -15,7 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include +#include +#include +#include #include #include #include @@ -31,13 +34,13 @@ extern "C" { #include "callbacks.h" }*/ -#include "Linux.h" + #include "Common.h" #define CALLBACK #include - +#include "Linux.h" static int prevbilinearfilter; //static map mapConfOpts; struct confOptsStruct{ @@ -99,7 +102,190 @@ void CALLBACK GSkeyEvent(keyEvent *ev) } } */ +class OGLConfigDialog : public wxDialog +{ + private: + + protected: + wxNotebook* m_notebook1; + wxPanel* VideoPanel; + wxCheckBox* FullscreenCheck; + wxCheckBox* RenderMainCheck; + wxStaticText* m_staticText1; + wxChoice* FullResoChoice; + wxStaticText* m_staticText2; + wxChoice* WindowResoChoice; + wxStaticText* m_staticText3; + wxChoice* AliasChoice; + wxPanel* EnhancePanel; + wxCheckBox* BilinChoice; + wxCheckBox* m_checkBox4; + wxCheckBox* m_checkBox6; + wxChoice* m_choice6; + wxPanel* AdvancedPanel; + wxCheckBox* Wireframecheck; + wxCheckBox* Statscheck; + wxCheckBox* ShaderissuesCheck; + wxCheckBox* TextureDumpChoice; + wxDirPickerCtrl* m_dirPicker2; + wxButton* m_button1; + + // event handlers + void OkayClick( wxMouseEvent& event ); + + + public: + OGLConfigDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 256,277 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~OGLConfigDialog(); + +}; +OGLConfigDialog::OGLConfigDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer2; + bSizer2 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer1; + bSizer1 = new wxBoxSizer( wxVERTICAL ); + + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0|wxALWAYS_SHOW_SB, wxT("Video Settings\nEnhancements\nAdvanced") ); + VideoPanel = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 2, 2, 0, 0 ); + + FullscreenCheck = new wxCheckBox( VideoPanel, wxID_ANY, wxT("Fullscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer1->Add( FullscreenCheck, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + RenderMainCheck = new wxCheckBox( VideoPanel, wxID_ANY, wxT("Render to Main Window"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer1->Add( RenderMainCheck, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_staticText1 = new wxStaticText( VideoPanel, wxID_ANY, wxT("FullScreen Video Mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + gSizer1->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + wxString FullResoChoiceChoices[] = { wxT("640x480") }; + int FullResoChoiceNChoices = sizeof( FullResoChoiceChoices ) / sizeof( wxString ); + FullResoChoice = new wxChoice( VideoPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, FullResoChoiceNChoices, FullResoChoiceChoices, 0 ); + FullResoChoice->SetSelection( 0 ); + gSizer1->Add( FullResoChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_staticText2 = new wxStaticText( VideoPanel, wxID_ANY, wxT("Windowed Resolution"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2->Wrap( -1 ); + gSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + wxString WindowResoChoiceChoices[] = { wxT("640x480") }; + int WindowResoChoiceNChoices = sizeof( WindowResoChoiceChoices ) / sizeof( wxString ); + WindowResoChoice = new wxChoice( VideoPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, WindowResoChoiceNChoices, WindowResoChoiceChoices, 0 ); + WindowResoChoice->SetSelection( 0 ); + gSizer1->Add( WindowResoChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_staticText3 = new wxStaticText( VideoPanel, wxID_ANY, wxT("Alias Mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText3->Wrap( -1 ); + gSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + wxString AliasChoiceChoices[] = { wxT("1x"), wxT("2x"), wxT("4x"), wxT("8x"), wxT("16x") }; + int AliasChoiceNChoices = sizeof( AliasChoiceChoices ) / sizeof( wxString ); + AliasChoice = new wxChoice( VideoPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, AliasChoiceNChoices, AliasChoiceChoices, 0 ); + AliasChoice->SetSelection( 0 ); + gSizer1->Add( AliasChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + VideoPanel->SetSizer( gSizer1 ); + VideoPanel->Layout(); + gSizer1->Fit( VideoPanel ); + m_notebook1->AddPage( VideoPanel, wxT("Video"), true ); + EnhancePanel = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxGridSizer* gSizer3; + gSizer3 = new wxGridSizer( 3, 1, 0, 0 ); + + BilinChoice = new wxCheckBox( EnhancePanel, wxID_ANY, wxT("Force bi/trilinear (May cause very small glitches)"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer3->Add( BilinChoice, 0, wxALL, 5 ); + + m_checkBox4 = new wxCheckBox( EnhancePanel, wxID_ANY, wxT("Force maximum anisotropy filtering"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer3->Add( m_checkBox4, 0, wxALL, 5 ); + + wxGridSizer* gSizer4; + gSizer4 = new wxGridSizer( 1, 2, 0, 0 ); + + m_checkBox6 = new wxCheckBox( EnhancePanel, wxID_ANY, wxT("Pre-Upscale:"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBox6->Enable( false ); + + gSizer4->Add( m_checkBox6, 0, wxALL, 5 ); + + wxArrayString m_choice6Choices; + m_choice6 = new wxChoice( EnhancePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice6Choices, 0 ); + m_choice6->SetSelection( 0 ); + m_choice6->Enable( false ); + + gSizer4->Add( m_choice6, 0, wxALL, 5 ); + + gSizer3->Add( gSizer4, 1, wxEXPAND, 5 ); + + EnhancePanel->SetSizer( gSizer3 ); + EnhancePanel->Layout(); + gSizer3->Fit( EnhancePanel ); + m_notebook1->AddPage( EnhancePanel, wxT("Enhancements"), false ); + AdvancedPanel = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxGridSizer* gSizer5; + gSizer5 = new wxGridSizer( 6, 0, 0, 0 ); + + Wireframecheck = new wxCheckBox( AdvancedPanel, wxID_ANY, wxT("Wireframe"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer5->Add( Wireframecheck, 0, wxALL, 5 ); + + Statscheck = new wxCheckBox( AdvancedPanel, wxID_ANY, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer5->Add( Statscheck, 0, wxALL, 5 ); + + ShaderissuesCheck = new wxCheckBox( AdvancedPanel, wxID_ANY, wxT("Show shader compilation issues"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer5->Add( ShaderissuesCheck, 0, wxALL, 5 ); + + TextureDumpChoice = new wxCheckBox( AdvancedPanel, wxID_ANY, wxT("Dump Textures To:"), wxDefaultPosition, wxDefaultSize, 0 ); + + gSizer5->Add( TextureDumpChoice, 0, wxALL, 5 ); + + m_dirPicker2 = new wxDirPickerCtrl( AdvancedPanel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE ); + gSizer5->Add( m_dirPicker2, 0, wxALIGN_CENTER|wxALL, 5 ); + + AdvancedPanel->SetSizer( gSizer5 ); + AdvancedPanel->Layout(); + gSizer5->Fit( AdvancedPanel ); + m_notebook1->AddPage( AdvancedPanel, wxT("Advanced"), false ); + + bSizer1->Add( m_notebook1, 1, wxALL|wxEXPAND, 5 ); + + m_button1 = new wxButton( this, wxID_ANY, wxT("Okay"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1->Add( m_button1, 0, wxALL, 5 ); + + bSizer2->Add( bSizer1, 1, wxEXPAND, 5 ); + + this->SetSizer( bSizer2 ); + this->Layout(); + + // Connect Events + m_button1->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( OGLConfigDialog::OkayClick ), NULL, this ); +} + +OGLConfigDialog::~OGLConfigDialog() +{ + // Disconnect Events + m_button1->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( OGLConfigDialog::OkayClick ), NULL, this ); +} +void OGLConfigDialog::OkayClick(wxMouseEvent& event) { + Close(true); +} +void Show_OGLSettings() +{ + OGLConfigDialog frame(NULL); + frame.ShowModal(); +} GtkWidget *Conf; GtkWidget *Logging; GList *fresl; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.h b/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.h index baf4053d95..76ca5bf785 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Linux/Linux.h @@ -18,6 +18,5 @@ #ifndef __LINUX_H__ #define __LINUX_H__ +void Show_OGLSettings(); #endif - -void OnToggle_advopts(GtkCellRendererToggle *cell, gchar *path, gpointer user_data); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 61d0f790bd..5ddb3400f1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -23,6 +23,6 @@ files = ["BPStructs.cpp", "Linux/Linux.cpp", ] -gfxenv=env.Copy(CXXFLAGS = " `pkg-config --cflags gtk+-2.0 xxf86vm`", LINKFLAGS = " `pkg-config --libs gtk+-2.0 xxf86vm`") +gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags --debug` `pkg-config --cflags gtk+-2.0 xxf86vm` ", LINKFLAGS = "`wx-config --libs --debug` `pkg-config --libs gtk+-2.0 xxf86vm` ") gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLEW", "CgGL", "Cg", "X11"]) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 5637c2aa8a..1a3ba032f1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -14,6 +14,11 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include +#include +#include +#include +#include #include #include "Globals.h" @@ -28,6 +33,8 @@ #include "DlgSettings.h" #include "Misc.h" #include "EmuWindow.h" +#else +#include "Linux/Linux.h" #endif #include "VertexLoader.h" #include "PixelShaderManager.h" @@ -38,15 +45,12 @@ HINSTANCE g_hInstance = NULL; SVideoInitialize g_VideoInitialize; #define VERSION_STRING "0.1" -#include "wx/wx.h" -#include "wx/aboutdlg.h" - class wxDLLApp : public wxApp { - bool OnInit() - { - return true; - } + bool OnInit() + { + return true; + } }; IMPLEMENT_APP_NO_MAIN(wxDLLApp) @@ -110,6 +114,8 @@ void DllConfig(HWND _hParent) { #ifdef _WIN32 DlgSettings_Show(g_hInstance,_hParent); +#else + Show_OGLSettings(); #endif }