static-ified a lot of vars to prevent name collisions with plugins, other cosmetic stuff, prep for jit debug

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@147 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-07 21:29:15 +00:00
parent ac366022f4
commit b370386983
26 changed files with 212 additions and 157 deletions

View File

@ -28,7 +28,7 @@
#include "PixelShaderManager.h"
// State translation lookup tables
const GLenum glSrcFactors[8] =
static const GLenum glSrcFactors[8] =
{
GL_ZERO,
GL_ONE,
@ -40,13 +40,13 @@ const GLenum glSrcFactors[8] =
GL_ONE_MINUS_DST_ALPHA
};
const GLenum glDestFactors[8] = {
static const GLenum glDestFactors[8] = {
GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR,
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA };
const GLenum glCmpFuncs[8] = { GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS };
static const GLenum glCmpFuncs[8] = { GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS };
const GLenum glLogicOpCodes[16] = {
static const GLenum glLogicOpCodes[16] = {
GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND,
GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, GL_OR_INVERTED };

View File

@ -28,8 +28,8 @@
FifoReader fifo;
static u8 *videoBuffer;
int size = 0;
int readptr = 0;
static int size = 0;
static int readptr = 0;
void Fifo_Init()
{

View File

@ -32,7 +32,7 @@ u32 s_nTargetWidth = 0, s_nTargetHeight = 0;
u32 g_AAx = 0, g_AAy = 0;
#ifndef _WIN32
GLWindow GLWin;
static GLWindow GLWin;
#endif
#ifdef _WIN32

View File

@ -576,7 +576,7 @@ void DVProfClear()
#ifdef _WIN32
// The one for Linux is in Linux/Linux.cpp
HANDLE hConsole = NULL;
static HANDLE hConsole = NULL;
void OpenConsole() {
COORD csize;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
@ -605,7 +605,7 @@ void CloseConsole() {
#endif
FILE* pfLog = NULL;
static FILE* pfLog = NULL;
void __Log(const char *fmt, ...)
{
char* Msg = (char*)alloca(strlen(fmt)+512);

View File

@ -41,7 +41,7 @@ bool WriteAlphaTest(char *&p);
const float epsilon = 1.0f/255.0f;
const char *tevKSelTableC[] = // KCSEL
static const char *tevKSelTableC[] = // KCSEL
{
"1.0f,1.0f,1.0f", //1 = 0x00
"0.875,0.875,0.875",//7_8 = 0x01
@ -77,7 +77,7 @@ const char *tevKSelTableC[] = // KCSEL
I_KCOLORS"[3].aaa",//K3_A = 0x1F
};
const char *tevKSelTableA[] = // KASEL
static const char *tevKSelTableA[] = // KASEL
{
"1.0f", //1 = 0x00
"0.875f",//7_8 = 0x01
@ -113,7 +113,7 @@ const char *tevKSelTableA[] = // KASEL
I_KCOLORS"[3].a",//K3_A = 0x1F
};
const char *tevScaleTable[] = // CS
static const char *tevScaleTable[] = // CS
{
"1.0f", //SCALE_1
"2.0f", //SCALE_2
@ -121,7 +121,7 @@ const char *tevScaleTable[] = // CS
"0.5f",//DIVIDE_2
};
const char *tevBiasTable[] = // TB
static const char *tevBiasTable[] = // TB
{
"", //ZERO,
"+0.5f", //ADDHALF,
@ -129,19 +129,19 @@ const char *tevBiasTable[] = // TB
"",
};
const char *tevOpTable[] = { // TEV
static const char *tevOpTable[] = { // TEV
"+", //TEVOP_ADD = 0,
"-", //TEVOP_SUB = 1,
};
const char *tevCompOpTable[] = { ">", "==" };
static const char *tevCompOpTable[] = { ">", "==" };
#define TEVCMP_R8 0
#define TEVCMP_GR16 1
#define TEVCMP_BGR24 2
#define TEVCMP_RGB8 3
const char *tevCInputTable[] = // CC
static const char *tevCInputTable[] = // CC
{
"prev.rgb", //CPREV,
"prev.aaa", //APREV,
@ -165,7 +165,8 @@ const char *tevCInputTable[] = // CC
"PADERROR", "PADERROR", "PADERROR", "PADERROR",
"PADERROR", "PADERROR", "PADERROR", "PADERROR",
};
const char *tevCInputTable2[] = // CC
static const char *tevCInputTable2[] = // CC
{
"prev", //CPREV,
"(prev.aaa)", //APREV,
@ -190,7 +191,7 @@ const char *tevCInputTable2[] = // CC
"PADERROR", "PADERROR", "PADERROR", "PADERROR",
};
const char *tevAInputTable[] = // CA
static const char *tevAInputTable[] = // CA
{
"prev.a", //APREV,
"c0.a", //A0,
@ -206,7 +207,7 @@ const char *tevAInputTable[] = // CA
"PADERROR", "PADERROR", "PADERROR",
};
const char *tevAInputTable2[] = // CA
static const char *tevAInputTable2[] = // CA
{
"prev", //APREV,
"c0", //A0,
@ -222,7 +223,7 @@ const char *tevAInputTable2[] = // CA
"PADERROR", "PADERROR", "PADERROR", "PADERROR",
};
const char *tevRasTable[] =
static const char *tevRasTable[] =
{
"colors[0]",
"colors[1]",
@ -234,27 +235,28 @@ const char *tevRasTable[] =
"float4(0,0,0,0)", // zero
};
const char *alphaRef[2] =
static const char *alphaRef[2] =
{
I_ALPHA"[0].x",
I_ALPHA"[0].y"
};
const char *tevTexFunc[] = { "tex2D", "texRECT" };
static const char *tevTexFunc[] = { "tex2D", "texRECT" };
const char *tevCOutputTable[] = { "prev.rgb", "c0.rgb", "c1.rgb", "c2.rgb" };
const char *tevAOutputTable[] = { "prev.a", "c0.a", "c1.a", "c2.a" };
const char* tevIndAlphaSel[] = {"", "x", "y", "z"};
const char* tevIndAlphaScale[] = {"", "*32","*16","*8"};
const char* tevIndBiasField[] = {"", "x", "y", "xy", "z", "xz", "yz", "xyz"}; // indexed by bias
const char* tevIndBiasAdd[] = {"-128.0f", "1.0f", "1.0f", "1.0f" }; // indexed by fmt
const char* tevIndWrapStart[] = {"0", "256", "128", "64", "32", "16", "0.001" };
const char* tevIndFmtScale[] = {"255.0f", "31.0f", "15.0f", "8.0f" };
static const char *tevCOutputTable[] = { "prev.rgb", "c0.rgb", "c1.rgb", "c2.rgb" };
static const char *tevAOutputTable[] = { "prev.a", "c0.a", "c1.a", "c2.a" };
static const char* tevIndAlphaSel[] = {"", "x", "y", "z"};
static const char* tevIndAlphaScale[] = {"", "*32","*16","*8"};
static const char* tevIndBiasField[] = {"", "x", "y", "xy", "z", "xz", "yz", "xyz"}; // indexed by bias
static const char* tevIndBiasAdd[] = {"-128.0f", "1.0f", "1.0f", "1.0f" }; // indexed by fmt
static const char* tevIndWrapStart[] = {"0", "256", "128", "64", "32", "16", "0.001" };
static const char* tevIndFmtScale[] = {"255.0f", "31.0f", "15.0f", "8.0f" };
#define WRITE p+=sprintf
const char *swapColors = "rgba";
char swapModeTable[4][5];
static const char *swapColors = "rgba";
static char swapModeTable[4][5];
static char text[16384];
void BuildSwapModeTable()
{
@ -269,7 +271,6 @@ void BuildSwapModeTable()
}
}
static char text[16384];
char *GeneratePixelShader(u32 texture_mask, bool has_zbuffer_target, bool bRenderZToCol0)
{
DVSTARTPROFILE();

View File

@ -47,13 +47,13 @@ static vector< pair<int, int> > s_vStoredPrimitives; // every element, mode and
static void (*fnSetupVertexPointers)() = NULL;
//these don't need to be saved
float posScale;
float tcScale[8];
int colElements[2];
float tcScaleU[8];
float tcScaleV[8];
int tcIndex;
int colIndex;
static float posScale;
static float tcScale[8];
static int colElements[2];
static float tcScaleU[8];
static float tcScaleV[8];
static int tcIndex;
static int colIndex;
#ifndef _WIN32
#undef inline
#define inline
@ -473,7 +473,6 @@ void VertexLoader::ProcessFormat()
u8 *old_code_ptr = GetWritableCodePtr();
SetCodePtr(m_compiledCode);
Util::EmitPrologue(6);
//INT3();
int offset = 0;
// Position

View File

@ -32,6 +32,7 @@ int bound(int i)
{
return (i>255)?255:((i<0)?0:i);
}
void yuv2rgb(int y, int u, int v, int &r, int &g, int &b)
{
b = bound((76283*(y - 16) + 132252*(u - 128))>>16);