diff --git a/Source/Core/VideoCommon/Src/GlobalControl.cpp b/Source/Core/VideoCommon/Src/GlobalControl.cpp deleted file mode 100644 index 8e47a0e538..0000000000 --- a/Source/Core/VideoCommon/Src/GlobalControl.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#include "GlobalControl.h" - -namespace -{ -// Control Variables -static bool g_ProjHack0; -static ProjectionHack g_ProjHack1; -static ProjectionHack g_ProjHack2; -} // Namespace - - -void Projection_SetHack0(bool value) -{ - g_ProjHack0 = value; -} - -void Projection_SetHack1(ProjectionHack value) -{ - g_ProjHack1 = value; -} - -void Projection_SetHack2(ProjectionHack value) -{ - g_ProjHack2 = value; -} - -bool Projection_GetHack0() -{ - return g_ProjHack0; -} - -ProjectionHack Projection_GetHack1() -{ - return g_ProjHack1; -} - -ProjectionHack Projection_GetHack2() -{ - return g_ProjHack2; -} - -void UpdateProjectionHack(int iPhackvalue) -{ - bool bProjHack1=0, bPhackvalue1=0, bPhackvalue2=0; - float fhackvalue1=0, fhackvalue2=0; - switch(iPhackvalue) - { - case PROJECTION_HACK_NONE: - bProjHack1 = 0; - bPhackvalue1 = 0; - bPhackvalue2 = 0; - break; - case PROJECTION_HACK_ZELDA_TP_BLOOM_HACK: - bPhackvalue1 = 1; - bProjHack1 = 1; - break; - case PROJECTION_HACK_SONIC_AND_THE_BLACK_KNIGHT: - bPhackvalue1 = 1; - fhackvalue1 = 0.00002f; - bPhackvalue2 = 1; - fhackvalue2 = 1.999980f; - break; - case PROJECTION_HACK_BLEACH_VERSUS_CRUSADE: - bPhackvalue2 = 1; - fhackvalue2 = 0.5f; - bPhackvalue1 = 0; - bProjHack1 = 0; - break; - case PROJECTION_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME: - bPhackvalue1 = 1; - fhackvalue1 = 0.8f; - bPhackvalue2 = 1; - fhackvalue2 = 1.2f; - bProjHack1 = 0; - break; - case PROJECTION_HACK_HARVESTMOON_MM: - bPhackvalue1 = 1; - fhackvalue1 = 0.0075f; - bPhackvalue2 = 0; - bProjHack1 = 0; - break; - case PROJECTION_HACK_BATEN_KAITOS: - bPhackvalue1 = 1; - fhackvalue1 = 0.0026f; - bPhackvalue2 = 1; - fhackvalue2 = 1.9974f; - bProjHack1 = 1; - break; - case PROJECTION_HACK_BATEN_KAITOS_ORIGIN: - bPhackvalue1 = 1; - fhackvalue1 = 0.0012f; - bPhackvalue2 = 1; - fhackvalue2 = 1.9988f; - bProjHack1 = 1; - break; - case PROJECTION_HACK_SKIES_OF_ARCADIA: - bPhackvalue1 = 1; - fhackvalue1 = 0.04f; - bPhackvalue2 = 0; - bProjHack1 = 0; - break; - } - - // Set the projections hacks - Projection_SetHack0(bProjHack1); - Projection_SetHack1(ProjectionHack(bPhackvalue1 == 0 ? false : true, fhackvalue1)); - Projection_SetHack2(ProjectionHack(bPhackvalue2 == 0 ? false : true, fhackvalue2)); -} - diff --git a/Source/Core/VideoCommon/Src/GlobalControl.h b/Source/Core/VideoCommon/Src/GlobalControl.h deleted file mode 100644 index f6c0bb337a..0000000000 --- a/Source/Core/VideoCommon/Src/GlobalControl.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -/* ----------------------------------------------------------------------- - Purpose: This is used to control parts of the video code such as hacks - ----------------------------------------------------------------------- */ - -#include "Common.h" - -enum -{ - PROJECTION_HACK_NONE = 0, - PROJECTION_HACK_ZELDA_TP_BLOOM_HACK = 1, - PROJECTION_HACK_SONIC_AND_THE_BLACK_KNIGHT = 2, - PROJECTION_HACK_BLEACH_VERSUS_CRUSADE = 3, - PROJECTION_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME = 4, - PROJECTION_HACK_HARVESTMOON_MM = 5, - PROJECTION_HACK_BATEN_KAITOS = 6, - PROJECTION_HACK_BATEN_KAITOS_ORIGIN = 7, - PROJECTION_HACK_SKIES_OF_ARCADIA = 8 -}; - -struct ProjectionHack -{ - bool enabled; - float value; - - ProjectionHack() - { - } - - ProjectionHack(bool new_enabled, float new_value) - { - enabled = new_enabled; - value = new_value; - } -}; - -/* ------------------- - Projection Control - ------------------- */ -void Projection_SetHack0(bool value); -void Projection_SetHack1(ProjectionHack value); -void Projection_SetHack2(ProjectionHack value); - -bool Projection_GetHack0(); -ProjectionHack Projection_GetHack1(); -ProjectionHack Projection_GetHack2(); - -void UpdateProjectionHack(int hackIdx); diff --git a/Source/Core/VideoCommon/Src/SConscript b/Source/Core/VideoCommon/Src/SConscript index 1e1b896627..fa69db1c4f 100644 --- a/Source/Core/VideoCommon/Src/SConscript +++ b/Source/Core/VideoCommon/Src/SConscript @@ -4,7 +4,6 @@ Import('env') files = [ 'VideoConfig.cpp', - 'GlobalControl.cpp', 'BPMemory.cpp', 'CPMemory.cpp', 'XFMemory.cpp', diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 08ee1d45f2..e078e3bd20 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -30,7 +30,6 @@ #include "CPMemory.h" #include "XFMemory.h" #include "VideoCommon.h" -#include "GlobalControl.h" // Temporary ugly declaration. namespace VertexManager @@ -56,6 +55,123 @@ static float s_fViewRotation[2]; void UpdateViewport(); +// Projection Hacks +void Projection_SetHack0(bool value); +void Projection_SetHack1(ProjectionHack value); +void Projection_SetHack2(ProjectionHack value); + +bool Projection_GetHack0(); +ProjectionHack Projection_GetHack1(); +ProjectionHack Projection_GetHack2(); + + +namespace +{ +// Control Variables +static bool g_ProjHack0; +static ProjectionHack g_ProjHack1; +static ProjectionHack g_ProjHack2; +} // Namespace + + +void Projection_SetHack0(bool value) +{ + g_ProjHack0 = value; +} + +void Projection_SetHack1(ProjectionHack value) +{ + g_ProjHack1 = value; +} + +void Projection_SetHack2(ProjectionHack value) +{ + g_ProjHack2 = value; +} + +bool Projection_GetHack0() +{ + return g_ProjHack0; +} + +ProjectionHack Projection_GetHack1() +{ + return g_ProjHack1; +} + +ProjectionHack Projection_GetHack2() +{ + return g_ProjHack2; +} + +void UpdateProjectionHack(int iPhackvalue) +{ + bool bProjHack1=0, bPhackvalue1=0, bPhackvalue2=0; + float fhackvalue1=0, fhackvalue2=0; + switch(iPhackvalue) + { + case PROJECTION_HACK_NONE: + bProjHack1 = 0; + bPhackvalue1 = 0; + bPhackvalue2 = 0; + break; + case PROJECTION_HACK_ZELDA_TP_BLOOM_HACK: + bPhackvalue1 = 1; + bProjHack1 = 1; + break; + case PROJECTION_HACK_SONIC_AND_THE_BLACK_KNIGHT: + bPhackvalue1 = 1; + fhackvalue1 = 0.00002f; + bPhackvalue2 = 1; + fhackvalue2 = 1.999980f; + break; + case PROJECTION_HACK_BLEACH_VERSUS_CRUSADE: + bPhackvalue2 = 1; + fhackvalue2 = 0.5f; + bPhackvalue1 = 0; + bProjHack1 = 0; + break; + case PROJECTION_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME: + bPhackvalue1 = 1; + fhackvalue1 = 0.8f; + bPhackvalue2 = 1; + fhackvalue2 = 1.2f; + bProjHack1 = 0; + break; + case PROJECTION_HACK_HARVESTMOON_MM: + bPhackvalue1 = 1; + fhackvalue1 = 0.0075f; + bPhackvalue2 = 0; + bProjHack1 = 0; + break; + case PROJECTION_HACK_BATEN_KAITOS: + bPhackvalue1 = 1; + fhackvalue1 = 0.0026f; + bPhackvalue2 = 1; + fhackvalue2 = 1.9974f; + bProjHack1 = 1; + break; + case PROJECTION_HACK_BATEN_KAITOS_ORIGIN: + bPhackvalue1 = 1; + fhackvalue1 = 0.0012f; + bPhackvalue2 = 1; + fhackvalue2 = 1.9988f; + bProjHack1 = 1; + break; + case PROJECTION_HACK_SKIES_OF_ARCADIA: + bPhackvalue1 = 1; + fhackvalue1 = 0.04f; + bPhackvalue2 = 0; + bProjHack1 = 0; + break; + } + + // Set the projections hacks + Projection_SetHack0(bProjHack1); + Projection_SetHack1(ProjectionHack(bPhackvalue1 == 0 ? false : true, fhackvalue1)); + Projection_SetHack2(ProjectionHack(bPhackvalue2 == 0 ? false : true, fhackvalue2)); +} + void VertexShaderManager::Init() { Dirty(); diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index 455ab6b8ad..14fc1e347b 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -20,6 +20,30 @@ #include "VertexShaderGen.h" +enum +{ + PROJECTION_HACK_NONE = 0, + PROJECTION_HACK_ZELDA_TP_BLOOM_HACK = 1, + PROJECTION_HACK_SONIC_AND_THE_BLACK_KNIGHT = 2, + PROJECTION_HACK_BLEACH_VERSUS_CRUSADE = 3, + PROJECTION_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME = 4, + PROJECTION_HACK_HARVESTMOON_MM = 5, + PROJECTION_HACK_BATEN_KAITOS = 6, + PROJECTION_HACK_BATEN_KAITOS_ORIGIN = 7, + PROJECTION_HACK_SKIES_OF_ARCADIA = 8 +}; + +struct ProjectionHack +{ + bool enabled; + float value; + ProjectionHack() { } + ProjectionHack(bool new_enabled, float new_value) + : enabled(new_enabled), value(new_value) {} +}; + +void UpdateProjectionHack(int hackIdx); + // The non-API dependent parts. class VertexShaderManager { diff --git a/Source/Core/VideoCommon/VideoCommon.vcproj b/Source/Core/VideoCommon/VideoCommon.vcproj index 0d32a1b96d..a999d88369 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcproj +++ b/Source/Core/VideoCommon/VideoCommon.vcproj @@ -1,7 +1,7 @@ - - - - diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index a62de52e7f..b8f7d8d670 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -23,7 +23,6 @@ #include "Atomic.h" #include "Thread.h" #include "LogManager.h" -#include "GlobalControl.h" #include "debugger/debugger.h" #if defined(HAVE_WX) && HAVE_WX diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 23ab84e7d7..b3f95f7fb5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -28,7 +28,7 @@ #include "../TextureMngr.h" #include "VertexShaderManager.h" #include "../PostProcessing.h" -#include "GlobalControl.h" +//#include "GlobalControl.h" #include "Render.h" #include "FileUtil.h" diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index a592c1e84a..17fdacc74f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -32,7 +32,7 @@ #include #endif -#include "GlobalControl.h" +//#include "GlobalControl.h" #include "CommonPaths.h" #include "VideoConfig.h" #include "Profiler.h"