From 5f3f7e197a7c692ecb379c2a37c1d132489659fb Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 12 Mar 2014 02:36:17 +1000 Subject: [PATCH] Linux build fix. --- rpcs3/CMakeLists.txt | 18 ++++++++++++++---- rpcs3/Emu/GS/GL/GLGSRender.cpp | 6 +++--- rpcs3/Emu/GS/GL/GLGSRender.h | 4 +--- rpcs3/Emu/GS/GL/OpenGL.h | 3 +++ rpcs3/Emu/SysCalls/Modules/cellL10n.cpp | 8 ++++++-- rpcs3/Emu/System.cpp | 16 ++++++++-------- rpcs3/Ini.cpp | 2 +- rpcs3/Ini.h | 12 ++++++------ rpcs3/Loader/Loader.cpp | 2 +- 9 files changed, 43 insertions(+), 28 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index ba436d5957..b0e9b5eb5d 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -10,21 +10,29 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules) -SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin") +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin") add_definitions(-DGL_GLEXT_PROTOTYPES) add_definitions(-DGLX_GLXEXT_PROTOTYPES) find_package(wxWidgets COMPONENTS core base net aui gl REQUIRED) +find_package(GLEW REQUIRED) find_package(OpenGL REQUIRED) -find_package(FFMPEG REQUIRED) find_package(ZLIB REQUIRED) +find_package(OpenAL REQUIRED) include("${wxWidgets_USE_FILE}") +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(PLATFORM_ARCH "linux/x86_64") +else() + set(PLATFORM_ARCH "linux/x86") +endif() + include_directories( ${wxWidgets_INCLUDE_DIRS} -${FFMPEG_INCLUDE_DIR} +${OPENAL_INCLUDE_DIR} +${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/include ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/Emu ${CMAKE_SOURCE_DIR}/Gui @@ -33,6 +41,8 @@ ${CMAKE_SOURCE_DIR}/Crypto ${CMAKE_SOURCE_DIR}/.. ) +link_directories(${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/lib) + file( GLOB_RECURSE RPCS3_SRC @@ -48,5 +58,5 @@ ${CMAKE_SOURCE_DIR}/../Utilities/* add_executable(rpcs3 ${RPCS3_SRC}) -target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES}) +target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES}) diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index 9e1b4a6fd0..699e23da97 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -2,7 +2,6 @@ #include "GLGSRender.h" #include "Emu/Cell/PPCInstrTable.h" #include "Gui/RSXDebugger.h" -#include "OpenGL.h" #define CMD_DEBUG 0 #define DUMP_VERTEX_DATA 0 @@ -650,10 +649,11 @@ void GLGSRender::OnInitThread() #ifdef _WIN32 glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0); -#else +// Undefined reference: glXSwapIntervalEXT +/*#else if (GLXDrawable drawable = glXGetCurrentDrawable()){ glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0); - } + }*/ #endif glGenTextures(1, &g_depth_tex); glGenTextures(1, &g_flip_tex); diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index 5f503bde02..4bd83f26e0 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -1,11 +1,9 @@ #pragma once #include "Emu/GS/GSRender.h" #include "Emu/GS/RSXThread.h" -#include #include "GLBuffers.h" -#include "GLProgram.h" -#include "OpenGL.h" #include "GLProgramBuffer.h" +#include #pragma comment(lib, "opengl32.lib") diff --git a/rpcs3/Emu/GS/GL/OpenGL.h b/rpcs3/Emu/GS/GL/OpenGL.h index 4089f466e1..5122b47589 100644 --- a/rpcs3/Emu/GS/GL/OpenGL.h +++ b/rpcs3/Emu/GS/GL/OpenGL.h @@ -1,4 +1,7 @@ #pragma once +#ifndef _WIN32 +#include +#endif #include #include "GL/glext.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp index dcf34cd9d7..7745ed224d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp @@ -2,7 +2,10 @@ #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" +// Requires GCC 4.10 apparently.. +#ifdef _MSC_VER #include +#endif void cellL10n_init(); Module cellL10n(0x001e, cellL10n_init); @@ -26,7 +29,7 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t std::u16string wstr =(char16_t*)Memory.VirtualToRealAddr(utf16); wstr.resize(utf16_len.GetValue()); // TODO: Is this really the role of utf16_len in this function? - +#ifdef _MSC_VER std::wstring_convert,char16_t> convert; std::string str = convert.to_bytes(wstr); @@ -36,6 +39,7 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t utf8_len = str.size(); Memory.WriteString(utf8, str.c_str()); +#endif return ConversionOK; } @@ -208,4 +212,4 @@ void cellL10n_init() // cellL10n.AddFunc(0xf9b1896d, SJISstoUCS2s); // cellL10n.AddFunc(0xfa4a675a, BIG5stoUCS2s); // cellL10n.AddFunc(0xfdbf6ac5, UTF8stoUCS2s); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 08f356707e..7c92cb7e3d 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -93,12 +93,12 @@ bool Emulator::BootGame(const std::string& path) { static const char* elf_path[6] = { - "\\PS3_GAME\\USRDIR\\BOOT.BIN", - "\\USRDIR\\BOOT.BIN", - "\\BOOT.BIN", - "\\PS3_GAME\\USRDIR\\EBOOT.BIN", - "\\USRDIR\\EBOOT.BIN", - "\\EBOOT.BIN", + "/PS3_GAME/USRDIR/BOOT.BIN", + "/USRDIR/BOOT.BIN", + "/BOOT.BIN", + "/PS3_GAME/USRDIR/EBOOT.BIN", + "/USRDIR/EBOOT.BIN", + "/EBOOT.BIN", }; for(int i=0; iGetPath()).GetPath()).GetPath(); wxString ps3_path; - const wxString& psf_path = root + "\\" + "PARAM.SFO"; + const wxString& psf_path = root + "/" + "PARAM.SFO"; vfsFile f(psf_path); if(f.IsOpened()) {