Linux build fix.

This commit is contained in:
Sacha 2014-03-12 02:36:17 +10:00
parent b7b33145f6
commit 5f3f7e197a
9 changed files with 43 additions and 28 deletions

View File

@ -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})

View File

@ -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);

View File

@ -1,11 +1,9 @@
#pragma once
#include "Emu/GS/GSRender.h"
#include "Emu/GS/RSXThread.h"
#include <wx/glcanvas.h>
#include "GLBuffers.h"
#include "GLProgram.h"
#include "OpenGL.h"
#include "GLProgramBuffer.h"
#include <wx/glcanvas.h>
#pragma comment(lib, "opengl32.lib")

View File

@ -1,4 +1,7 @@
#pragma once
#ifndef _WIN32
#include <GL/glew.h>
#endif
#include <GL/gl.h>
#include "GL/glext.h"

View File

@ -2,7 +2,10 @@
#include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h"
// Requires GCC 4.10 apparently..
#ifdef _MSC_VER
#include <codecvt>
#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<std::codecvt_utf8_utf16<char16_t>,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;
}

View File

@ -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; i<sizeof(elf_path) / sizeof(*elf_path);i++)
@ -128,11 +128,11 @@ void Emulator::Load()
if(wxFileName(m_path).GetFullName().CmpNoCase("EBOOT.BIN") == 0)
{
elf_path += "\\BOOT.BIN";
elf_path += "/BOOT.BIN";
}
else
{
elf_path += "\\" + wxFileName(m_path).GetName() + ".elf";
elf_path += "/" + wxFileName(m_path).GetName() + ".elf";
}
if(!DecryptSelf(elf_path, self_path))

View File

@ -152,7 +152,7 @@ Ini::Ini()
{
#ifdef _WIN32
m_Config = new wxIniConfig( wxEmptyString, wxEmptyString,
wxGetCwd() + "\\rpcs3.ini",
wxGetCwd() + "/rpcs3.ini",
wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
#else
m_Config = new wxConfig("rpcs3");

View File

@ -132,11 +132,11 @@ public:
{
wxString path;
path = DefPath + "\\" + "CPU";
path = DefPath + "/" + "CPU";
CPUDecoderMode.Init("DecoderMode", path);
CPUIgnoreRWErrors.Init("IgnoreRWErrors", path);
path = DefPath + "\\" + "GS";
path = DefPath + "/" + "GS";
GSRenderMode.Init("RenderMode", path);
GSResolution.Init("Resolution", path);
GSAspectRatio.Init("AspectRatio", path);
@ -145,12 +145,12 @@ public:
GSDumpColorBuffers.Init("DumpColorBuffers", path);
GSDumpDepthBuffer.Init("DumpDepthBuffer", path);
path = DefPath + "\\" + "IO";
path = DefPath + "/" + "IO";
PadHandlerMode.Init("PadHandlerMode", path);
KeyboardHandlerMode.Init("KeyboardHandlerMode", path);
MouseHandlerMode.Init("MouseHandlerMode", path);
path = DefPath + "\\" + "ControlSetings";
path = DefPath + "/" + "ControlSetings";
PadHandlerLeft.Init("PadHandlerLeft", path);
PadHandlerDown.Init("PadHandlerDown", path);
PadHandlerRight.Init("PadHandlerRight", path);
@ -168,11 +168,11 @@ public:
PadHandlerR2.Init("PadHandlerR2", path);
PadHandlerL2.Init("PadHandlerL2", path);
path = DefPath + "\\" + "Audio";
path = DefPath + "/" + "Audio";
AudioOutMode.Init("AudioOutMode", path);
AudioDumpToFile.Init("AudioDumpToFile", path);
path = DefPath + "\\" + "HLE";
path = DefPath + "/" + "HLE";
HLELogging.Init("HLELogging", path);
HLESaveTTY.Init("HLESaveTTY", path);
HLEExitOnStop.Init("HLEExitOnStop", path);

View File

@ -165,7 +165,7 @@ bool Loader::Load()
/*
const wxString& root = wxFileName(wxFileName(m_stream->GetPath()).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())
{