@@ -24,7 +24,7 @@ void CreateIndexBuffer(GLuint* pBuffer, const void* pData, UINT DataSize, bool b
2424 return CreateBuffer (pBuffer, pData, DataSize, bImmutable, true );
2525}
2626
27- GLsizei VertexSizeList[] =
27+ const GLsizei VertexSizeList[] =
2828{
2929 1 , // D3DDECLTYPE_FLOAT1
3030 2 , // D3DDECLTYPE_FLOAT2
@@ -45,7 +45,7 @@ GLsizei VertexSizeList[] =
4545 4 // D3DDECLTYPE_FLOAT16_4
4646};
4747
48- GLenum VertexTypeList[] =
48+ const GLenum VertexTypeList[] =
4949{
5050 GL_FLOAT, // D3DDECLTYPE_FLOAT1
5151 GL_FLOAT, // D3DDECLTYPE_FLOAT2
@@ -66,7 +66,7 @@ GLenum VertexTypeList[] =
6666 GL_HALF_FLOAT // D3DDECLTYPE_FLOAT16_4
6767};
6868
69- GLboolean VertexNormalizedList[] =
69+ const GLboolean VertexNormalizedList[] =
7070{
7171 GL_FALSE, // D3DDECLTYPE_FLOAT1
7272 GL_FALSE, // D3DDECLTYPE_FLOAT2
@@ -87,7 +87,7 @@ GLboolean VertexNormalizedList[] =
8787 GL_FALSE // D3DDECLTYPE_FLOAT16_4
8888};
8989
90- GLsizei VertexTypeSizeList[] =
90+ const GLsizei VertexTypeSizeList[] =
9191{
9292 sizeof (GLfloat), // D3DDECLTYPE_FLOAT1
9393 sizeof (GLfloat), // D3DDECLTYPE_FLOAT2
@@ -108,22 +108,22 @@ GLsizei VertexTypeSizeList[] =
108108 sizeof (GLhalf) // D3DDECLTYPE_FLOAT16_4
109109};
110110
111- GLuint VertexUsageList[] =
111+ const GLuint VertexUsageList[] =
112112{
113113 3 , // D3DDECLUSAGE_POSITION
114- - 1 , // D3DDECLUSAGE_BLENDWEIGHT
115- - 1 , // D3DDECLUSAGE_BLENDINDICES
114+ ~ 0u , // D3DDECLUSAGE_BLENDWEIGHT
115+ ~ 0u , // D3DDECLUSAGE_BLENDINDICES
116116 5 , // D3DDECLUSAGE_NORMAL
117- - 1 , // D3DDECLUSAGE_PSIZE
117+ ~ 0u , // D3DDECLUSAGE_PSIZE
118118 8 , // D3DDECLUSAGE_TEXCOORD
119119 4 , // D3DDECLUSAGE_TANGENT
120120 6 , // D3DDECLUSAGE_BINORMAL
121- - 1 , // D3DDECLUSAGE_TESSFACTOR
122- - 1 , // D3DDECLUSAGE_POSITIONT
121+ ~ 0u , // D3DDECLUSAGE_TESSFACTOR
122+ ~ 0u , // D3DDECLUSAGE_POSITIONT
123123 0 , // D3DDECLUSAGE_COLOR
124124 7 , // D3DDECLUSAGE_FOG
125- - 1 , // D3DDECLUSAGE_DEPTH
126- - 1 , // D3DDECLUSAGE_SAMPLE
125+ ~ 0u , // D3DDECLUSAGE_DEPTH
126+ ~ 0u , // D3DDECLUSAGE_SAMPLE
127127};
128128
129129GLsizei GetDeclVertexSize (const D3DVERTEXELEMENT9* decl)
@@ -145,6 +145,7 @@ void ConvertVertexDeclaration(const D3DVERTEXELEMENT9* dxdecl, SDeclaration* dec
145145{
146146 RCache.set_Format (decl);
147147
148+ // XXX: tamlin: use 'stride', or drop it.
148149 GLsizei stride = GetDeclVertexSize (dxdecl);
149150 for (int i = 0 ; i < MAXD3DDECLLENGTH; ++i)
150151 {
@@ -279,4 +280,4 @@ u32 GetDeclLength(const D3DVERTEXELEMENT9 *decl)
279280 return element - decl;
280281}
281282
282- };
283+ } // namespace glBufferUtils
0 commit comments