Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #716 from delroth/vertex-loader
Make vertex loader testable
  • Loading branch information
delroth committed Aug 4, 2014
2 parents 89adfba + 1fcf07f commit e15ec56
Show file tree
Hide file tree
Showing 47 changed files with 647 additions and 113 deletions.
7 changes: 6 additions & 1 deletion Source/Core/Common/CMakeLists.txt
Expand Up @@ -48,6 +48,11 @@ if(WIN32)
set(SRCS ${SRCS} ExtendedTrace.cpp)
endif(WIN32)

set(LIBS "${CMAKE_THREAD_LIBS_INIT}")
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT ANDROID))
set(LIBS ${LIBS} rt)
endif()

enable_precompiled_headers(stdafx.h stdafx.cpp SRCS)

add_dolphin_library(common "${SRCS}" "${CMAKE_THREAD_LIBS_INIT}")
add_dolphin_library(common "${SRCS}" "${LIBS}")
15 changes: 14 additions & 1 deletion Source/Core/Core/CMakeLists.txt
Expand Up @@ -221,7 +221,18 @@ if(_M_ARM_32)
)
endif()

set(LIBS bdisasm inputcommon videoogl videosoftware sfml-network)
set(LIBS
audiocommon
bdisasm
common
discio
inputcommon
${LZO}
sfml-network
videoogl
videosoftware
z
)

if(LIBUSB_FOUND)
# Using shared LibUSB
Expand All @@ -236,6 +247,8 @@ if(WIN32)
HW/WiimoteReal/IOWin.cpp)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} HW/BBA-TAP/TAP_Apple.cpp HW/WiimoteReal/IOdarwin.mm)
set(LIBS ${LIBS}
${IOB_LIBRARY})
elseif(UNIX)
set(SRCS ${SRCS} HW/BBA-TAP/TAP_Unix.cpp)
if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND BLUEZ_FOUND)
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/Host.h
Expand Up @@ -42,6 +42,8 @@ void Host_UpdateLogDisplay();
void Host_UpdateMainFrame();
void Host_UpdateStatusBar(const std::string& text, int Filed = 0);
void Host_UpdateTitle(const std::string& title);
void Host_ShowVideoConfig(void* parent, const std::string& backend_name,
const std::string& config_name);

// TODO (neobrain): Remove this from host!
void* Host_GetRenderHandle();
31 changes: 4 additions & 27 deletions Source/Core/DolphinWX/CMakeLists.txt
Expand Up @@ -4,41 +4,17 @@ endif()

set(LIBS core
${LZO}
discio
bdisasm
inputcommon
common
audiocommon
z
sfml-network
${GTK2_LIBRARIES})

if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT ANDROID))
set(LIBS ${LIBS} rt)
endif()

if(NOT ANDROID)
if(USE_X11)
set(LIBS ${LIBS} ${X11_LIBRARIES}
${XINPUT2_LIBRARIES}
${XRANDR_LIBRARIES})
set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
endif()
if(USE_WAYLAND)
set(LIBS ${LIBS} ${WAYLAND_LIBRARIES}
${XKBCOMMON_LIBRARIES})
set(LIBS ${LIBS} ${WAYLAND_LIBRARIES} ${XKBCOMMON_LIBRARIES})
endif()

link_directories(${CMAKE_PREFIX_PATH}/lib)

if(SDL2_FOUND)
# Using shared SDL2
set(LIBS ${LIBS} ${SDL2_LIBRARY})
else(SDL2_FOUND)
if(SDL_FOUND)
# Using shared SDL
set(LIBS ${LIBS} ${SDL_LIBRARY})
endif()
endif()
else()
set(LIBS ${LIBS} png iconv)
endif()
Expand Down Expand Up @@ -87,6 +63,7 @@ if(wxWidgets_FOUND)
MemoryCards/WiiSaveCrypted.cpp
NetWindow.cpp
PatchAddEdit.cpp
SoftwareVideoConfigDialog.cpp
TASInputDlg.cpp
VideoConfigDiag.cpp
WXInputBase.cpp
Expand Down Expand Up @@ -123,6 +100,7 @@ else()

endif()
endif()
set(SRCS ${SRCS} GLInterface/GLInterface.cpp)

if(WIN32)
set(SRCS ${SRCS} stdafx.cpp)
Expand All @@ -134,7 +112,6 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
${COREAUDIO_LIBRARY}
${COREFUND_LIBRARY}
${CORESERV_LIBRARY}
${IOB_LIBRARY}
${IOK_LIBRARY}
${FORCEFEEDBACK}
)
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/DolphinWX/DolphinWX.vcxproj
Expand Up @@ -74,6 +74,7 @@
<ClCompile Include="FrameTools.cpp" />
<ClCompile Include="GameListCtrl.cpp" />
<ClCompile Include="GeckoCodeDiag.cpp" />
<ClCompile Include="GLInterface\GLInterface.cpp" />
<ClCompile Include="GLInterface\WGL.cpp" />
<ClCompile Include="HotkeyDlg.cpp" />
<ClCompile Include="InputConfigDiag.cpp" />
Expand All @@ -90,6 +91,7 @@
<ClCompile Include="MemoryCards\WiiSaveCrypted.cpp" />
<ClCompile Include="NetWindow.cpp" />
<ClCompile Include="PatchAddEdit.cpp" />
<ClCompile Include="SoftwareVideoConfigDialog.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
Expand Down Expand Up @@ -125,7 +127,6 @@
<ClInclude Include="Frame.h" />
<ClInclude Include="GameListCtrl.h" />
<ClInclude Include="GeckoCodeDiag.h" />
<ClInclude Include="GLInterface\InterfaceBase.h" />
<ClInclude Include="GLInterface\WGL.h" />
<ClInclude Include="Globals.h" />
<ClInclude Include="HotkeyDlg.h" />
Expand All @@ -139,6 +140,7 @@
<ClInclude Include="MemoryCards\WiiSaveCrypted.h" />
<ClInclude Include="NetWindow.h" />
<ClInclude Include="PatchAddEdit.h" />
<ClInclude Include="SoftwareVideoConfigDialog.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="TASInputDlg.h" />
<ClInclude Include="VideoConfigDiag.h" />
Expand Down
8 changes: 7 additions & 1 deletion Source/Core/DolphinWX/DolphinWX.vcxproj.filters
Expand Up @@ -27,6 +27,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="GLInterface\GLInterface.cpp" />
<ClCompile Include="GLInterface\WGL.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="MainNoGUI.cpp" />
Expand Down Expand Up @@ -153,9 +154,11 @@
<Filter>GUI</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="SoftwareVideoConfigDialog.cpp">
<Filter>GUI\Video</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GLInterface\InterfaceBase.h" />
<ClInclude Include="GLInterface\WGL.h" />
<ClInclude Include="Main.h" />
<ClInclude Include="WXInputBase.h" />
Expand Down Expand Up @@ -276,6 +279,9 @@
</ClInclude>
<ClInclude Include="stdafx.h" />
<ClInclude Include="GLInterface\GLInterface.h" />
<ClInclude Include="SoftwareVideoConfigDialog.h">
<Filter>GUI\Video</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/GLInterface/AGL.h
Expand Up @@ -8,7 +8,7 @@
#import <AppKit/AppKit.h>
#endif

#include "DolphinWX/GLInterface/InterfaceBase.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"

class cInterfaceAGL : public cInterfaceBase
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/GLInterface/EGL.h
Expand Up @@ -8,7 +8,7 @@
#include <EGL/egl.h>

#include "Core/ConfigManager.h"
#include "DolphinWX/GLInterface/InterfaceBase.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"


class cPlatform
Expand Down
23 changes: 23 additions & 0 deletions Source/Core/DolphinWX/GLInterface/GLInterface.cpp
@@ -0,0 +1,23 @@
// Copyright 2014 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#include "DolphinWX/GLInterface/GLInterface.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"

GLWindow GLWin;

cInterfaceBase* HostGL_CreateGLInterface()
{
#if defined(USE_EGL) && USE_EGL
return new cInterfaceEGL;
#elif defined(__APPLE__)
return new cInterfaceAGL;
#elif defined(_WIN32)
return new cInterfaceWGL;
#elif defined(HAVE_X11) && HAVE_X11
return new cInterfaceGLX;
#else
return nullptr;
#endif
}
1 change: 0 additions & 1 deletion Source/Core/DolphinWX/GLInterface/GLInterface.h
Expand Up @@ -108,5 +108,4 @@ typedef struct {
unsigned int width, height;
} GLWindow;

extern cInterfaceBase *GLInterface;
extern GLWindow GLWin;
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/GLInterface/GLX.h
Expand Up @@ -6,8 +6,8 @@

#include <string>

#include "DolphinWX/GLInterface/InterfaceBase.h"
#include "DolphinWX/GLInterface/X11_Util.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"

class cInterfaceGLX : public cInterfaceBase
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/GLInterface/WGL.h
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include <string>
#include "DolphinWX/GLInterface/InterfaceBase.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"

class cInterfaceWGL : public cInterfaceBase
{
Expand Down
17 changes: 17 additions & 0 deletions Source/Core/DolphinWX/Main.cpp
Expand Up @@ -46,6 +46,8 @@
#include "DolphinWX/Frame.h"
#include "DolphinWX/Globals.h"
#include "DolphinWX/Main.h"
#include "DolphinWX/SoftwareVideoConfigDialog.h"
#include "DolphinWX/VideoConfigDiag.h"
#include "DolphinWX/WxUtils.h"
#include "DolphinWX/Debugger/CodeWindow.h"
#include "DolphinWX/Debugger/JitWindow.h"
Expand Down Expand Up @@ -686,3 +688,18 @@ void Host_ConnectWiimote(int wm_idx, bool connect)
{
CFrame::ConnectWiimote(wm_idx, connect);
}

void Host_ShowVideoConfig(void* parent, const std::string& backend_name,
const std::string& config_name)
{
if (backend_name == "Direct3D" || backend_name == "OpenGL")
{
VideoConfigDiag diag((wxWindow*)parent, backend_name, config_name);
diag.ShowModal();
}
else if (backend_name == "Software Renderer")
{
SoftwareVideoConfigDialog diag((wxWindow*)parent, backend_name, config_name);
diag.ShowModal();
}
}
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/MainAndroid.cpp
Expand Up @@ -125,6 +125,8 @@ void Host_SysMessage(const char *fmt, ...)

void Host_SetWiiMoteConnectionState(int _State) {}

void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}

#define DVD_BANNER_WIDTH 96
#define DVD_BANNER_HEIGHT 32
std::vector<std::string> m_volume_names;
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/DolphinWX/MainNoGUI.cpp
Expand Up @@ -17,6 +17,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreParameter.h"
#include "Core/Host.h"
#include "Core/HW/Wiimote.h"
#include "Core/PowerPC/PowerPC.h"

Expand Down Expand Up @@ -133,6 +134,8 @@ void Host_SysMessage(const char *fmt, ...)

void Host_SetWiiMoteConnectionState(int _State) {}

void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}

#if HAVE_X11
void X11_MainLoop()
{
Expand Down

0 comments on commit e15ec56

Please sign in to comment.