D3D: Projection hack feature. Have also moved related functions and constant definitions from OGL to VideoCommon, will clean up the code better if it works for D3D.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4252 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
rice1964 2009-09-11 05:50:02 +00:00
parent 5ffb48c33b
commit e1a0f8884a
4 changed files with 147 additions and 60 deletions

View File

@ -77,3 +77,72 @@ bool Projection_GetWidescreen()
{ {
return g_Widescreen; return g_Widescreen;
} }
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;
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));
}

View File

@ -21,6 +21,19 @@
#include "Common.h" #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 struct ProjectionHack
{ {
bool enabled; bool enabled;
@ -51,3 +64,5 @@ ProjectionHack Projection_GetHack1();
ProjectionHack Projection_GetHack2(); ProjectionHack Projection_GetHack2();
bool Projection_GetFreeLook(); bool Projection_GetFreeLook();
bool Projection_GetWidescreen(); bool Projection_GetWidescreen();
void UpdateProjectionHack(int hackIdx);

View File

@ -23,6 +23,7 @@
#include "Atomic.h" #include "Atomic.h"
#include "Thread.h" #include "Thread.h"
#include "LogManager.h" #include "LogManager.h"
#include "GlobalControl.h"
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
@ -183,6 +184,7 @@ bool Init()
{ {
g_Config.Load(); g_Config.Load();
g_Config.GameIniLoad(); g_Config.GameIniLoad();
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
if (initCount == 0) if (initCount == 0)
{ {

View File

@ -789,66 +789,67 @@ void GFXConfigDialogOGL::UpdateGUI()
void Config::UpdateProjectionHack() void Config::UpdateProjectionHack()
{ {
switch(g_Config.iPhackvalue) ::UpdateProjectionHack(g_Config.iPhackvalue);
{ //switch(g_Config.iPhackvalue)
case OGL_HACK_NONE: //{
g_Config.bProjHack1 = 0; //case OGL_HACK_NONE:
g_Config.bPhackvalue1 = 0; // g_Config.bProjHack1 = 0;
g_Config.bPhackvalue2 = 0; // g_Config.bPhackvalue1 = 0;
break; // g_Config.bPhackvalue2 = 0;
case OGL_HACK_ZELDA_TP_BLOOM_HACK: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_ZELDA_TP_BLOOM_HACK:
g_Config.bProjHack1 = 1; // g_Config.bPhackvalue1 = 1;
break; // g_Config.bProjHack1 = 1;
case OGL_HACK_SONIC_AND_THE_BLACK_KNIGHT: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_SONIC_AND_THE_BLACK_KNIGHT:
g_Config.fhackvalue1 = 0.00002f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 1; // g_Config.fhackvalue1 = 0.00002f;
g_Config.fhackvalue2 = 1.999980f; // g_Config.bPhackvalue2 = 1;
break; // g_Config.fhackvalue2 = 1.999980f;
case OGL_HACK_BLEACH_VERSUS_CRUSADE: // break;
g_Config.bPhackvalue2 = 1; //case OGL_HACK_BLEACH_VERSUS_CRUSADE:
g_Config.fhackvalue2 = 0.5f; // g_Config.bPhackvalue2 = 1;
g_Config.bPhackvalue1 = 0; // g_Config.fhackvalue2 = 0.5f;
g_Config.bProjHack1 = 0; // g_Config.bPhackvalue1 = 0;
break; // g_Config.bProjHack1 = 0;
case OGL_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_FINAL_FANTASY_CC_ECHO_OF_TIME:
g_Config.fhackvalue1 = 0.8f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 1; // g_Config.fhackvalue1 = 0.8f;
g_Config.fhackvalue2 = 1.2f; // g_Config.bPhackvalue2 = 1;
g_Config.bProjHack1 = 0; // g_Config.fhackvalue2 = 1.2f;
break; // g_Config.bProjHack1 = 0;
case OGL_HACK_HARVESTMOON_MM: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_HARVESTMOON_MM:
g_Config.fhackvalue1 = 0.0075f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 0; // g_Config.fhackvalue1 = 0.0075f;
g_Config.bProjHack1 = 0; // g_Config.bPhackvalue2 = 0;
case OGL_HACK_BATEN_KAITOS: // g_Config.bProjHack1 = 0;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_BATEN_KAITOS:
g_Config.fhackvalue1 = 0.0026f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 1; // g_Config.fhackvalue1 = 0.0026f;
g_Config.fhackvalue2 = 1.9974f; // g_Config.bPhackvalue2 = 1;
g_Config.bProjHack1 = 1; // g_Config.fhackvalue2 = 1.9974f;
break; // g_Config.bProjHack1 = 1;
case OGL_HACK_BATEN_KAITOS_ORIGIN: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_BATEN_KAITOS_ORIGIN:
g_Config.fhackvalue1 = 0.0012f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 1; // g_Config.fhackvalue1 = 0.0012f;
g_Config.fhackvalue2 = 1.9988f; // g_Config.bPhackvalue2 = 1;
g_Config.bProjHack1 = 1; // g_Config.fhackvalue2 = 1.9988f;
break; // g_Config.bProjHack1 = 1;
case OGL_HACK_SKIES_OF_ARCADIA: // break;
g_Config.bPhackvalue1 = 1; //case OGL_HACK_SKIES_OF_ARCADIA:
g_Config.fhackvalue1 = 0.04f; // g_Config.bPhackvalue1 = 1;
g_Config.bPhackvalue2 = 0; // g_Config.fhackvalue1 = 0.04f;
g_Config.bProjHack1 = 0; // g_Config.bPhackvalue2 = 0;
break; // g_Config.bProjHack1 = 0;
} // break;
//}
// Set the projections hacks
Projection_SetHack0(g_Config.bProjHack1); //// Set the projections hacks
Projection_SetHack1(ProjectionHack(g_Config.bPhackvalue1 == 0 ? false : true, g_Config.fhackvalue1)); //Projection_SetHack0(g_Config.bProjHack1);
Projection_SetHack2(ProjectionHack(g_Config.bPhackvalue2 == 0 ? false : true, g_Config.fhackvalue2)); //Projection_SetHack1(ProjectionHack(g_Config.bPhackvalue1 == 0 ? false : true, g_Config.fhackvalue1));
//Projection_SetHack2(ProjectionHack(g_Config.bPhackvalue2 == 0 ? false : true, g_Config.fhackvalue2));
} }