summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-09-13 10:18:01 +0000
committerhrydgard <hrydgard@gmail.com>2009-09-13 10:18:01 +0000
commit73d2b3e9684da5eb43280b7facbf2f31d584a75b (patch)
tree5ab368e37a1eefb2f2153b9dbf01afef1cd155e1 /Source/Core
parent2d93c654f09e86b00a14b0929f07089c137bcc05 (diff)
more uninteresting cleanup, fixed a minor race condition when toggling efb copy mode
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4261 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/Core.cpp4
-rw-r--r--Source/Core/VideoCommon/Src/GlobalControl.cpp23
-rw-r--r--Source/Core/VideoCommon/Src/GlobalControl.h4
-rw-r--r--Source/Core/VideoCommon/Src/Render.h2
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderManager.cpp6
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.cpp12
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.h12
7 files changed, 22 insertions, 41 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index e31661fadc..0dae5721fa 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -348,7 +348,7 @@ THREAD_RETURN EmuThread(void *pArg)
CPluginManager &Plugins = CPluginManager::GetInstance();
if (_CoreParameter.bLockThreads)
- Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
+ Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
INFO_LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "Gamecube");
INFO_LOG(OSREPORT, "Dualcore = %s", _CoreParameter.bUseDualCore ? "Yes" : "No");
@@ -485,6 +485,8 @@ THREAD_RETURN EmuThread(void *pArg)
#ifdef _WIN32
// the spawned CPU Thread is the... CPU thread but it also does the graphics.
// the EmuThread is thus an idle thread, which sleeps and wait for the emu to terminate.
+ // Without this extra thread, the video plugin window hangs in single core mode since
+ // noone is pumping messages.
cpuThread = new Common::Thread(CpuThread, pArg);
Common::SetCurrentThreadName("Emuthread - Idle");
diff --git a/Source/Core/VideoCommon/Src/GlobalControl.cpp b/Source/Core/VideoCommon/Src/GlobalControl.cpp
index 2dbb13901b..f345502e27 100644
--- a/Source/Core/VideoCommon/Src/GlobalControl.cpp
+++ b/Source/Core/VideoCommon/Src/GlobalControl.cpp
@@ -23,8 +23,6 @@ namespace
static bool g_ProjHack0;
static ProjectionHack g_ProjHack1;
static ProjectionHack g_ProjHack2;
-static bool g_FreeLook;
-static bool g_Widescreen;
} // Namespace
@@ -43,16 +41,6 @@ void Projection_SetHack2(ProjectionHack value)
g_ProjHack2 = value;
}
-void Projection_SetFreeLook(bool enabled)
-{
- g_FreeLook = enabled;
-}
-
-void Projection_SetWidescreen(bool enabled)
-{
- g_Widescreen = enabled;
-}
-
bool Projection_GetHack0()
{
return g_ProjHack0;
@@ -68,17 +56,6 @@ ProjectionHack Projection_GetHack2()
return g_ProjHack2;
}
-bool Projection_GetFreeLook()
-{
- return g_FreeLook;
-}
-
-bool Projection_GetWidescreen()
-{
- return g_Widescreen;
-}
-
-
void UpdateProjectionHack(int iPhackvalue)
{
bool bProjHack1=0, bPhackvalue1=0, bPhackvalue2=0;
diff --git a/Source/Core/VideoCommon/Src/GlobalControl.h b/Source/Core/VideoCommon/Src/GlobalControl.h
index 1019191d9e..f6c0bb337a 100644
--- a/Source/Core/VideoCommon/Src/GlobalControl.h
+++ b/Source/Core/VideoCommon/Src/GlobalControl.h
@@ -56,13 +56,9 @@ struct ProjectionHack
void Projection_SetHack0(bool value);
void Projection_SetHack1(ProjectionHack value);
void Projection_SetHack2(ProjectionHack value);
-void Projection_SetFreeLook(bool enabled);
-void Projection_SetWidescreen(bool enabled);
bool Projection_GetHack0();
ProjectionHack Projection_GetHack1();
ProjectionHack Projection_GetHack2();
-bool Projection_GetFreeLook();
-bool Projection_GetWidescreen();
void UpdateProjectionHack(int hackIdx);
diff --git a/Source/Core/VideoCommon/Src/Render.h b/Source/Core/VideoCommon/Src/Render.h
index ad0e734dbc..598ab9595c 100644
--- a/Source/Core/VideoCommon/Src/Render.h
+++ b/Source/Core/VideoCommon/Src/Render.h
@@ -88,4 +88,6 @@ public:
static void Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight);
};
+void UpdateViewport();
+
#endif // _COMMON_RENDER_H_
diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
index cfaf4b74ef..b19fb54a8a 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
@@ -16,6 +16,7 @@
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
+#include "VideoConfig.h"
#include "MathUtil.h"
#include "Profiler.h"
@@ -216,9 +217,8 @@ void VertexShaderManager::SetConstants()
if (xfregs.rawProjection[6] == 0)
{
- bool bWidescreenHack = Projection_GetWidescreen();
// Perspective
- g_fProjectionMatrix[0] = (bWidescreenHack ? xfregs.rawProjection[0]*0.75f : xfregs.rawProjection[0]);
+ g_fProjectionMatrix[0] = (g_ActiveConfig.bWidescreenHack ? xfregs.rawProjection[0]*0.75f : xfregs.rawProjection[0]);
g_fProjectionMatrix[1] = 0.0f;
g_fProjectionMatrix[2] = xfregs.rawProjection[1];
g_fProjectionMatrix[3] = 0.0f;
@@ -313,7 +313,7 @@ void VertexShaderManager::SetConstants()
PRIM_LOG("Projection: %f %f %f %f %f %f\n", xfregs.rawProjection[0], xfregs.rawProjection[1], xfregs.rawProjection[2], xfregs.rawProjection[3], xfregs.rawProjection[4], xfregs.rawProjection[5]);
- if (Projection_GetFreeLook())
+ if (g_ActiveConfig.bFreeLook)
{
Matrix44 mtxA;
Matrix44 mtxB;
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp
index 4c171f1db3..e95503a2f8 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp
@@ -22,20 +22,20 @@
#include "VideoConfig.h"
#include "VideoCommon.h"
-Config g_Config;
-Config g_ActiveConfig;
+VideoConfig g_Config;
+VideoConfig g_ActiveConfig;
void UpdateActiveConfig()
{
g_ActiveConfig = g_Config;
}
-Config::Config()
+VideoConfig::VideoConfig()
{
bRunning = false;
}
-void Config::Load(const char *ini_file)
+void VideoConfig::Load(const char *ini_file)
{
std::string temp;
IniFile iniFile;
@@ -105,7 +105,7 @@ void Config::Load(const char *ini_file)
SetEnableAlert(bTmp);
}
-void Config::GameIniLoad(const char *ini_file)
+void VideoConfig::GameIniLoad(const char *ini_file)
{
IniFile iniFile;
iniFile.Load(ini_file);
@@ -121,7 +121,7 @@ void Config::GameIniLoad(const char *ini_file)
iniFile.Get("Video", "ProjectionHack", &iPhackvalue, 0);
}
-void Config::Save(const char *ini_file)
+void VideoConfig::Save(const char *ini_file)
{
IniFile iniFile;
iniFile.Load(ini_file);
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h
index 07512e083e..c78b8d2dba 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.h
+++ b/Source/Core/VideoCommon/Src/VideoConfig.h
@@ -51,9 +51,9 @@ enum MultisampleMode {
class IniFile;
// NEVER inherit from this class.
-struct Config
+struct VideoConfig
{
- Config();
+ VideoConfig();
void Load(const char *ini_file);
void GameIniLoad(const char *ini_file);
void Save(const char *ini_file);
@@ -128,12 +128,16 @@ struct Config
bool bVsync;
+ // With this enabled, the plugin renders directly to the backbuffer. Many features are
+ // disabled but it might be faster on really old GPUs.
+ bool bSimpleFB;
+
// Runtime detection config
bool bOldCard;
};
-extern Config g_Config;
-extern Config g_ActiveConfig;
+extern VideoConfig g_Config;
+extern VideoConfig g_ActiveConfig;
// Called every frame.
void UpdateActiveConfig();