Link the video plugin statically into the main binary on OS X.

This makes the OS X build more robust and should help pave the
way for the integration of the video plugins as well as LTO.

There are now no more global class level namespace conflicts left,
as evidenced by the fact that Dolphin can be linked with -all_load,
not that you would want to.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6958 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-29 04:52:19 +00:00
parent 4c58c7ea03
commit 1bcad428ea
25 changed files with 145 additions and 178 deletions

View File

@ -274,7 +274,7 @@ namespace Clipper
void ProcessTriangle(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
{
if (stats.thisFrame.numDrawnObjects < g_Config.drawStart || stats.thisFrame.numDrawnObjects >= g_Config.drawEnd )
if (stats.thisFrame.numDrawnObjects < g_SWVideoConfig.drawStart || stats.thisFrame.numDrawnObjects >= g_SWVideoConfig.drawEnd )
return;
INCSTAT(stats.thisFrame.numTrianglesIn)

View File

@ -216,10 +216,10 @@ void OnObjectBegin()
{
if (!g_bSkipCurrentFrame)
{
if (g_Config.bDumpTextures && stats.thisFrame.numDrawnObjects >= g_Config.drawStart && stats.thisFrame.numDrawnObjects < g_Config.drawEnd)
if (g_SWVideoConfig.bDumpTextures && stats.thisFrame.numDrawnObjects >= g_SWVideoConfig.drawStart && stats.thisFrame.numDrawnObjects < g_SWVideoConfig.drawEnd)
DumpActiveTextures();
if (g_Config.bHwRasterizer)
if (g_SWVideoConfig.bHwRasterizer)
{
HwRasterizer::BeginTriangles();
drawingHwTriangles = true;
@ -231,10 +231,10 @@ void OnObjectEnd()
{
if (!g_bSkipCurrentFrame)
{
if (g_Config.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_Config.drawStart && stats.thisFrame.numDrawnObjects < g_Config.drawEnd)
if (g_SWVideoConfig.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_SWVideoConfig.drawStart && stats.thisFrame.numDrawnObjects < g_SWVideoConfig.drawEnd)
DumpEfb(StringFromFormat("%sobject%i.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.thisFrame.numDrawnObjects).c_str());
if (g_Config.bHwRasterizer || drawingHwTriangles)
if (g_SWVideoConfig.bHwRasterizer || drawingHwTriangles)
{
HwRasterizer::EndTriangles();
drawingHwTriangles = false;
@ -259,7 +259,7 @@ void OnFrameEnd()
{
if (!g_bSkipCurrentFrame)
{
if (g_Config.bDumpFrames)
if (g_SWVideoConfig.bDumpFrames)
{
DumpEfb(StringFromFormat("%sframe%i_color.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.frameCount).c_str());
DumpDepth(StringFromFormat("%sframe%i_depth.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.frameCount).c_str());

View File

@ -35,7 +35,7 @@ namespace EfbCopy
{
OpenGL_Update(); // just updates the render window position and the backbuffer size
if (!g_Config.bHwRasterizer)
if (!g_SWVideoConfig.bHwRasterizer)
{
// copy to open gl for rendering
EfbInterface::UpdateColorTexture();
@ -48,7 +48,7 @@ namespace EfbCopy
void CopyToRam()
{
if (!g_Config.bHwRasterizer)
if (!g_SWVideoConfig.bHwRasterizer)
{
u8 *dest_ptr = g_VideoInitialize.pGetMemoryPointer(bpmem.copyTexDest << 5);
@ -96,7 +96,7 @@ namespace EfbCopy
if (bpmem.triggerEFBCopy.clear)
{
if (g_Config.bHwRasterizer)
if (g_SWVideoConfig.bHwRasterizer)
HwRasterizer::Clear();
else
ClearEfb();

View File

@ -296,7 +296,7 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer
{
INCSTAT(stats.thisFrame.numTrianglesDrawn);
if (g_Config.bHwRasterizer)
if (g_SWVideoConfig.bHwRasterizer)
{
HwRasterizer::DrawTriangleFrontFace(v0, v1, v2);
return;

View File

@ -125,7 +125,7 @@ void Renderer::DrawDebugText()
char *p = debugtext_buffer;
p[0] = 0;
if (g_Config.bShowStats)
if (g_SWVideoConfig.bShowStats)
{
p+=sprintf(p,"Objects: %i\n",stats.thisFrame.numDrawnObjects);
p+=sprintf(p,"Primatives: %i\n",stats.thisFrame.numPrimatives);

View File

@ -4,8 +4,6 @@ Import('env')
import os
import sys
name = os.sep + "Plugin_VideoSoftware"
files = [
'BPMemLoader.cpp',
'Clipper.cpp',
@ -40,6 +38,21 @@ if env['HAVE_WX']:
if sys.platform == 'win32':
files += [ 'Win32.cpp' ]
libs = [ 'videocommon', 'GLEW', 'SOIL', 'common' ]
#env['LIBS'] += ['videocommon']
#
#if env['HAVE_WX']:
# env['LIBS'] += [ 'videouicommon' ]
# XXX partially converted to libvideocommon, but there are still conflicts
files += [
'../../../Core/VideoCommon/Src/ImageWrite.cpp',
'../../../Core/VideoCommon/Src/IndexGenerator.cpp',
'../../../Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp',
'../../../Core/VideoCommon/Src/TextureDecoder.cpp',
'../../../Core/VideoCommon/Src/VertexLoader_Color.cpp',
'../../../Core/VideoCommon/Src/VertexLoader_Normal.cpp',
'../../../Core/VideoCommon/Src/VertexLoader_Position.cpp',
'../../../Core/VideoCommon/Src/VertexLoader_TextCoord.cpp',
'../../../Core/VideoCommon/Src/VertexManagerBase.cpp',
]
env.SharedLibrary(env['plugin_dir'] + name, files, LIBS = env['LIBS'] + libs)
env['libvideo'] = env.StaticLibrary(env['local_libs'] + 'video', files)

View File

@ -599,7 +599,7 @@ void Tev::Draw()
IndirectLod[stageNum], IndirectLinear[stageNum], texmap, IndirectTex[stageNum]);
#if ALLOW_TEV_DUMPS
if (g_Config.bDumpTevStages)
if (g_SWVideoConfig.bDumpTevStages)
{
u8 stage[4] = { IndirectTex[stageNum][TextureSampler::ALP_SMP],
IndirectTex[stageNum][TextureSampler::BLU_SMP],
@ -635,7 +635,7 @@ void Tev::Draw()
TextureSampler::Sample(TexCoord.s, TexCoord.t, TextureLod[stageNum], TextureLinear[stageNum], texmap, texel);
#if ALLOW_TEV_DUMPS
if (g_Config.bDumpTevTextureFetches)
if (g_SWVideoConfig.bDumpTevTextureFetches)
DebugUtil::DrawTempBuffer(texel, DIRECT_TFETCH + stageNum);
#endif
@ -689,7 +689,7 @@ void Tev::Draw()
Reg[ac.dest][ALP_C] = Clamp1024(Reg[ac.dest][ALP_C]);
#if ALLOW_TEV_DUMPS
if (g_Config.bDumpTevStages)
if (g_SWVideoConfig.bDumpTevStages)
{
u8 stage[4] = {(u8)Reg[0][RED_C], (u8)Reg[0][GRN_C], (u8)Reg[0][BLU_C], (u8)Reg[0][ALP_C]};
DebugUtil::DrawTempBuffer(stage, DIRECT + stageNum);
@ -791,7 +791,7 @@ void Tev::Draw()
}
#if ALLOW_TEV_DUMPS
if (g_Config.bDumpTevStages)
if (g_SWVideoConfig.bDumpTevStages)
{
for (u32 i = 0; i < bpmem.genMode.numindstages; ++i)
DebugUtil::CopyTempBuffer(Position[0], Position[1], INDIRECT, i, "Indirect");
@ -799,7 +799,7 @@ void Tev::Draw()
DebugUtil::CopyTempBuffer(Position[0], Position[1], DIRECT, i, "Stage");
}
if (g_Config.bDumpTevTextureFetches)
if (g_SWVideoConfig.bDumpTevTextureFetches)
{
for (u32 i = 0; i <= bpmem.genMode.numtevstages; ++i)
{

View File

@ -19,7 +19,7 @@
#include "IniFile.h"
#include "VideoConfig.h"
SWVideoConfig g_Config;
SWVideoConfig g_SWVideoConfig;
SWVideoConfig::SWVideoConfig()
{

View File

@ -50,6 +50,6 @@ struct SWVideoConfig : NonCopyable
u32 drawEnd;
};
extern SWVideoConfig g_Config;
extern SWVideoConfig g_SWVideoConfig;
#endif // _PLUGIN_VIDEOSOFTWARE_CONFIG_H_

View File

@ -49,7 +49,7 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title,
wxDialog(parent, -1,
wxString(wxT("Dolphin ")).append(wxString::FromAscii(title.c_str())).append(wxT(" Graphics Configuration")),
wxDefaultPosition, wxDefaultSize),
vconfig(g_Config),
vconfig(g_SWVideoConfig),
ininame(_ininame)
{
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
@ -137,7 +137,7 @@ void VideoConfigDialog::Event_ClickClose(wxCommandEvent&)
void VideoConfigDialog::Event_Close(wxCloseEvent& ev)
{
g_Config.Save((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
g_SWVideoConfig.Save((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
ev.Skip();
}

View File

@ -129,7 +129,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
{
case VK_RETURN:
// Pressing Alt+Enter switch FullScreen/Windowed
if (m_hParent == NULL && !g_Config.renderToMainframe)
if (m_hParent == NULL && !g_SWVideoConfig.renderToMainframe)
{
ToggleFullscreen(hWnd);
}
@ -146,7 +146,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
switch (LOWORD( wParam ))
{
case VK_ESCAPE:
if (g_Config.bFullscreen)
if (g_SWVideoConfig.bFullscreen)
{
// Pressing Esc switches to Windowed mode from Fullscreen mode
ToggleFullscreen(hWnd);
@ -195,7 +195,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
if (m_hParent == NULL)
{
// Take it out of fullscreen and stop the game
if( g_Config.bFullscreen )
if( g_SWVidoConfig.bFullscreen )
ToggleFullscreen(m_hParent);
PostMessage(m_hParent, WM_USER, WM_USER_STOP, 0);
}
@ -262,7 +262,7 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
// Create new separate window
else
{
DWORD style = g_Config.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
DWORD style = g_SWVideoConfig.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
RECT rc = {0, 0, width, height};
AdjustWindowRect(&rc, style, false);
@ -294,10 +294,10 @@ void ToggleFullscreen(HWND hParent)
if (m_hParent == NULL)
{
int w_fs = 640, h_fs = 480;
if (g_Config.bFullscreen)
if (g_SWVideoConfig.bFullscreen)
{
// Get out of fullscreen
g_Config.bFullscreen = false;
g_SWVideoConfig.bFullscreen = false;
RECT rc = {0, 0, w_fs, h_fs};
// FullScreen -> Desktop
@ -336,7 +336,7 @@ void ToggleFullscreen(HWND hParent)
// Set new window style -> PopUp
SetWindowLong(hParent, GWL_STYLE, WS_POPUP);
g_Config.bFullscreen = true;
g_SWVideoConfig.bFullscreen = true;
ShowCursor(FALSE);
// SetWindowPos to the upper-left corner of the screen

View File

@ -85,7 +85,7 @@ void Initialize(void *init)
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
g_VideoInitialize = *_pVideoInitialize;
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_software.ini").c_str());
g_SWVideoConfig.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_software.ini").c_str());
InitBPMemory();
InitXFMemory();