Commit b4090613 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make some constant arrays also static.

As pointed out by Dan Kegel.
parent bcf0b4b1
......@@ -1631,7 +1631,7 @@ static GLuint create_arb_blt_vertex_program(const WineD3D_GL_Info *gl_info)
static GLuint create_arb_blt_fragment_program(const WineD3D_GL_Info *gl_info, enum tex_types tex_type)
{
GLuint program_id = 0;
const char *blt_fprograms[tex_type_count] =
static const char * const blt_fprograms[tex_type_count] =
{
/* tex_1d */
NULL,
......
......@@ -1092,11 +1092,11 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This,
checkGLcall("glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)");
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_FILLMODE));
if(patch->has_normals) {
const GLfloat black[4] = {0, 0, 0, 0};
const GLfloat red[4] = {1, 0, 0, 0};
const GLfloat green[4] = {0, 1, 0, 0};
const GLfloat blue[4] = {0, 0, 1, 0};
const GLfloat white[4] = {1, 1, 1, 1};
static const GLfloat black[] = {0, 0, 0, 0};
static const GLfloat red[] = {1, 0, 0, 0};
static const GLfloat green[] = {0, 1, 0, 0};
static const GLfloat blue[] = {0, 0, 1, 0};
static const GLfloat white[] = {1, 1, 1, 1};
glEnable(GL_LIGHTING);
checkGLcall("glEnable(GL_LIGHTING)");
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, black);
......@@ -1263,9 +1263,9 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This,
if(patch->has_normals) {
/* Now do the same with reverse light directions */
const GLfloat x[4] = {-1, 0, 0, 0};
const GLfloat y[4] = { 0, -1, 0, 0};
const GLfloat z[4] = { 0, 0, -1, 0};
static const GLfloat x[] = {-1, 0, 0, 0};
static const GLfloat y[] = { 0, -1, 0, 0};
static const GLfloat z[] = { 0, 0, -1, 0};
glLightfv(GL_LIGHT0, GL_POSITION, x);
glLightfv(GL_LIGHT1, GL_POSITION, y);
glLightfv(GL_LIGHT2, GL_POSITION, z);
......
......@@ -96,7 +96,8 @@ static void print_glsl_info_log(const WineD3D_GL_Info *gl_info, GLhandleARB obj)
unsigned int i;
BOOL is_spam;
const char *spam[] = {
static const char * const spam[] =
{
"Vertex shader was successfully compiled to run on hardware.\n", /* fglrx */
"Fragment shader was successfully compiled to run on hardware.\n", /* fglrx */
"Fragment shader(s) linked, vertex shader(s) linked. \n ", /* fglrx, with \n */
......@@ -3306,7 +3307,8 @@ static GLhandleARB create_glsl_blt_shader(const WineD3D_GL_Info *gl_info, enum t
{
GLhandleARB program_id;
GLhandleARB vshader_id, pshader_id;
const char *blt_vshader[] = {
static const char *blt_vshader[] =
{
"#version 120\n"
"void main(void)\n"
"{\n"
......@@ -3316,7 +3318,8 @@ static GLhandleARB create_glsl_blt_shader(const WineD3D_GL_Info *gl_info, enum t
"}\n"
};
const char *blt_pshaders[tex_type_count] = {
static const char *blt_pshaders[tex_type_count] =
{
/* tex_1d */
NULL,
/* tex_2d */
......
......@@ -702,7 +702,7 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
checkGLcall("glFinalCombinerInputNV()");
}
} else {
const GLfloat black[4] = {0.0f, 0.0f, 0.0f, 0.0f};
static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
/* for the case of enabled lighting: */
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]);
......@@ -1323,7 +1323,7 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*)&device->updateStateBlock->material.Specular);
checkGLcall("glMaterialfv");
} else {
const GLfloat black[4] = {0.0f, 0.0f, 0.0f, 0.0f};
static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]);
checkGLcall("glMaterialfv");
}
......@@ -3175,10 +3175,10 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const WineDirect3D
static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / WINED3D_HIGHEST_TEXTURE_STATE;
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
const GLfloat s_plane[] = { 1.0, 0.0, 0.0, 0.0 };
const GLfloat t_plane[] = { 0.0, 1.0, 0.0, 0.0 };
const GLfloat r_plane[] = { 0.0, 0.0, 1.0, 0.0 };
const GLfloat q_plane[] = { 0.0, 0.0, 0.0, 1.0 };
static const GLfloat s_plane[] = { 1.0, 0.0, 0.0, 0.0 };
static const GLfloat t_plane[] = { 0.0, 1.0, 0.0, 0.0 };
static const GLfloat r_plane[] = { 0.0, 0.0, 1.0, 0.0 };
static const GLfloat q_plane[] = { 0.0, 0.0, 0.0, 1.0 };
if (mapped_stage == -1) {
TRACE("No texture unit mapped to stage %d. Skipping texture coordinates.\n", stage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment