Delete the misnamed GlobalControl.cpp/h, move the (ugly) projection hack code that was there into VertexShaderManager where it belongs.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4644 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
973441d703
commit
f0bba97070
|
@ -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));
|
||||
}
|
||||
|
|
@ -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);
|
|
@ -4,7 +4,6 @@ Import('env')
|
|||
|
||||
files = [
|
||||
'VideoConfig.cpp',
|
||||
'GlobalControl.cpp',
|
||||
'BPMemory.cpp',
|
||||
'CPMemory.cpp',
|
||||
'XFMemory.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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="VideoCommon"
|
||||
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
|
||||
RootNamespace="VideoCommon"
|
||||
|
@ -734,14 +734,6 @@
|
|||
RelativePath=".\Src\CommandProcessor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\GlobalControl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\GlobalControl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\memcpy_amd.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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <mmsystem.h>
|
||||
#endif
|
||||
|
||||
#include "GlobalControl.h"
|
||||
//#include "GlobalControl.h"
|
||||
#include "CommonPaths.h"
|
||||
#include "VideoConfig.h"
|
||||
#include "Profiler.h"
|
||||
|
|
Loading…
Reference in New Issue