Commit a07a8f79 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: D3DDECLTYPE: Consistently use in WINED3D namespace.

parent f0d5b35c
...@@ -494,12 +494,12 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -494,12 +494,12 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
and if so using the fixed pipeline how do we handle it */ and if so using the fixed pipeline how do we handle it */
if (thisFVF & D3DFVF_POSITION_MASK) { if (thisFVF & D3DFVF_POSITION_MASK) {
strided->u.s.position.lpData = data; strided->u.s.position.lpData = data;
strided->u.s.position.dwType = D3DDECLTYPE_FLOAT3; strided->u.s.position.dwType = WINED3DDECLTYPE_FLOAT3;
strided->u.s.position.dwStride = stride; strided->u.s.position.dwStride = stride;
strided->u.s.position.VBO = streamVBO; strided->u.s.position.VBO = streamVBO;
data += 3 * sizeof(float); data += 3 * sizeof(float);
if (thisFVF & D3DFVF_XYZRHW) { if (thisFVF & D3DFVF_XYZRHW) {
strided->u.s.position.dwType = D3DDECLTYPE_FLOAT4; strided->u.s.position.dwType = WINED3DDECLTYPE_FLOAT4;
strided->u.s.position_transformed = TRUE; strided->u.s.position_transformed = TRUE;
data += sizeof(float); data += sizeof(float);
} else } else
...@@ -514,14 +514,14 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -514,14 +514,14 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
if ((thisFVF & D3DFVF_XYZB5 ) > D3DFVF_XYZRHW) { if ((thisFVF & D3DFVF_XYZB5 ) > D3DFVF_XYZRHW) {
TRACE("Setting blend Weights to %p\n", data); TRACE("Setting blend Weights to %p\n", data);
strided->u.s.blendWeights.lpData = data; strided->u.s.blendWeights.lpData = data;
strided->u.s.blendWeights.dwType = D3DDECLTYPE_FLOAT1 + numBlends - 1; strided->u.s.blendWeights.dwType = WINED3DDECLTYPE_FLOAT1 + numBlends - 1;
strided->u.s.blendWeights.dwStride = stride; strided->u.s.blendWeights.dwStride = stride;
strided->u.s.blendWeights.VBO = streamVBO; strided->u.s.blendWeights.VBO = streamVBO;
data += numBlends * sizeof(FLOAT); data += numBlends * sizeof(FLOAT);
if (thisFVF & D3DFVF_LASTBETA_UBYTE4) { if (thisFVF & D3DFVF_LASTBETA_UBYTE4) {
strided->u.s.blendMatrixIndices.lpData = data; strided->u.s.blendMatrixIndices.lpData = data;
strided->u.s.blendMatrixIndices.dwType = D3DDECLTYPE_UBYTE4; strided->u.s.blendMatrixIndices.dwType = WINED3DDECLTYPE_UBYTE4;
strided->u.s.blendMatrixIndices.dwStride= stride; strided->u.s.blendMatrixIndices.dwStride= stride;
strided->u.s.blendMatrixIndices.VBO = streamVBO; strided->u.s.blendMatrixIndices.VBO = streamVBO;
data += sizeof(DWORD); data += sizeof(DWORD);
...@@ -531,7 +531,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -531,7 +531,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
/* Normal is always 3 floats */ /* Normal is always 3 floats */
if (thisFVF & D3DFVF_NORMAL) { if (thisFVF & D3DFVF_NORMAL) {
strided->u.s.normal.lpData = data; strided->u.s.normal.lpData = data;
strided->u.s.normal.dwType = D3DDECLTYPE_FLOAT3; strided->u.s.normal.dwType = WINED3DDECLTYPE_FLOAT3;
strided->u.s.normal.dwStride = stride; strided->u.s.normal.dwStride = stride;
strided->u.s.normal.VBO = streamVBO; strided->u.s.normal.VBO = streamVBO;
data += 3 * sizeof(FLOAT); data += 3 * sizeof(FLOAT);
...@@ -540,7 +540,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -540,7 +540,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
/* Pointsize is a single float */ /* Pointsize is a single float */
if (thisFVF & D3DFVF_PSIZE) { if (thisFVF & D3DFVF_PSIZE) {
strided->u.s.pSize.lpData = data; strided->u.s.pSize.lpData = data;
strided->u.s.pSize.dwType = D3DDECLTYPE_FLOAT1; strided->u.s.pSize.dwType = WINED3DDECLTYPE_FLOAT1;
strided->u.s.pSize.dwStride = stride; strided->u.s.pSize.dwStride = stride;
strided->u.s.pSize.VBO = streamVBO; strided->u.s.pSize.VBO = streamVBO;
data += sizeof(FLOAT); data += sizeof(FLOAT);
...@@ -549,7 +549,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -549,7 +549,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
/* Diffuse is 4 unsigned bytes */ /* Diffuse is 4 unsigned bytes */
if (thisFVF & D3DFVF_DIFFUSE) { if (thisFVF & D3DFVF_DIFFUSE) {
strided->u.s.diffuse.lpData = data; strided->u.s.diffuse.lpData = data;
strided->u.s.diffuse.dwType = D3DDECLTYPE_SHORT4; strided->u.s.diffuse.dwType = WINED3DDECLTYPE_SHORT4;
strided->u.s.diffuse.dwStride = stride; strided->u.s.diffuse.dwStride = stride;
strided->u.s.diffuse.VBO = streamVBO; strided->u.s.diffuse.VBO = streamVBO;
data += sizeof(DWORD); data += sizeof(DWORD);
...@@ -558,7 +558,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -558,7 +558,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
/* Specular is 4 unsigned bytes */ /* Specular is 4 unsigned bytes */
if (thisFVF & D3DFVF_SPECULAR) { if (thisFVF & D3DFVF_SPECULAR) {
strided->u.s.specular.lpData = data; strided->u.s.specular.lpData = data;
strided->u.s.specular.dwType = D3DDECLTYPE_SHORT4; strided->u.s.specular.dwType = WINED3DDECLTYPE_SHORT4;
strided->u.s.specular.dwStride = stride; strided->u.s.specular.dwStride = stride;
strided->u.s.specular.VBO = streamVBO; strided->u.s.specular.VBO = streamVBO;
data += sizeof(DWORD); data += sizeof(DWORD);
...@@ -578,7 +578,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -578,7 +578,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
for (textureNo = 0; textureNo < numTextures; ++textureNo) { for (textureNo = 0; textureNo < numTextures; ++textureNo) {
strided->u.s.texCoords[textureNo].lpData = data; strided->u.s.texCoords[textureNo].lpData = data;
strided->u.s.texCoords[textureNo].dwType = D3DDECLTYPE_FLOAT1; strided->u.s.texCoords[textureNo].dwType = WINED3DDECLTYPE_FLOAT1;
strided->u.s.texCoords[textureNo].dwStride = stride; strided->u.s.texCoords[textureNo].dwStride = stride;
strided->u.s.texCoords[textureNo].VBO = streamVBO; strided->u.s.texCoords[textureNo].VBO = streamVBO;
numCoords[textureNo] = coordIdxInfo & 0x03; numCoords[textureNo] = coordIdxInfo & 0x03;
...@@ -586,13 +586,13 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi ...@@ -586,13 +586,13 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
/* Always one set */ /* Always one set */
data += sizeof(float); data += sizeof(float);
if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT1) { if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT1) {
strided->u.s.texCoords[textureNo].dwType = D3DDECLTYPE_FLOAT2; strided->u.s.texCoords[textureNo].dwType = WINED3DDECLTYPE_FLOAT2;
data += sizeof(float); data += sizeof(float);
if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT2) { if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT2) {
strided->u.s.texCoords[textureNo].dwType = D3DDECLTYPE_FLOAT3; strided->u.s.texCoords[textureNo].dwType = WINED3DDECLTYPE_FLOAT3;
data += sizeof(float); data += sizeof(float);
if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT3) { if (numCoords[textureNo] != D3DFVF_TEXTUREFORMAT3) {
strided->u.s.texCoords[textureNo].dwType = D3DDECLTYPE_FLOAT4; strided->u.s.texCoords[textureNo].dwType = WINED3DDECLTYPE_FLOAT4;
data += sizeof(float); data += sizeof(float);
} }
} }
...@@ -1408,7 +1408,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData ...@@ -1408,7 +1408,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
continue; continue;
} else { } else {
int coordsToUse = sd->u.s.texCoords[coordIdx].dwType + 1; /* 0 == D3DDECLTYPE_FLOAT1 etc */ int coordsToUse = sd->u.s.texCoords[coordIdx].dwType + 1; /* 0 == WINED3DDECLTYPE_FLOAT1 etc */
/* The coords to supply depend completely on the fvf / vertex shader */ /* The coords to supply depend completely on the fvf / vertex shader */
switch (coordsToUse) { switch (coordsToUse) {
...@@ -1508,7 +1508,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData ...@@ -1508,7 +1508,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
if (sd->u.s.specular.lpData != NULL) { if (sd->u.s.specular.lpData != NULL) {
/* special case where the fog density is stored in the diffuse alpha channel */ /* special case where the fog density is stored in the diffuse alpha channel */
if(This->stateBlock->renderState[WINED3DRS_FOGENABLE] && if(This->stateBlock->renderState[WINED3DRS_FOGENABLE] &&
(This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == D3DFOG_NONE || sd->u.s.position.dwType == D3DDECLTYPE_FLOAT4 )&& (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == D3DFOG_NONE || sd->u.s.position.dwType == WINED3DDECLTYPE_FLOAT4 )&&
This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == D3DFOG_NONE) { This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == D3DFOG_NONE) {
if(GL_SUPPORT(EXT_FOG_COORD)) { if(GL_SUPPORT(EXT_FOG_COORD)) {
GL_EXTCALL(glFogCoordfEXT(specularColor >> 24)); GL_EXTCALL(glFogCoordfEXT(specularColor >> 24));
......
...@@ -92,25 +92,25 @@ typedef struct _WINED3DGLTYPE { ...@@ -92,25 +92,25 @@ typedef struct _WINED3DGLTYPE {
int typesize; int typesize;
} WINED3DGLTYPE; } WINED3DGLTYPE;
/* NOTE: Make sure these are in the correct numerical order. (see /include/d3d9types.h typedef enum _D3DDECLTYPE) */ /* NOTE: Make sure these are in the correct numerical order. (see /include/wined3d_types.h) */
static WINED3DGLTYPE const glTypeLookup[D3DDECLTYPE_UNUSED] = { static WINED3DGLTYPE const glTypeLookup[WINED3DDECLTYPE_UNUSED] = {
{D3DDECLTYPE_FLOAT1, 1, GL_FLOAT , GL_FALSE ,sizeof(float)}, {WINED3DDECLTYPE_FLOAT1, 1, GL_FLOAT , GL_FALSE ,sizeof(float)},
{D3DDECLTYPE_FLOAT2, 2, GL_FLOAT , GL_FALSE ,sizeof(float)}, {WINED3DDECLTYPE_FLOAT2, 2, GL_FLOAT , GL_FALSE ,sizeof(float)},
{D3DDECLTYPE_FLOAT3, 3, GL_FLOAT , GL_FALSE ,sizeof(float)}, {WINED3DDECLTYPE_FLOAT3, 3, GL_FLOAT , GL_FALSE ,sizeof(float)},
{D3DDECLTYPE_FLOAT4, 4, GL_FLOAT , GL_FALSE ,sizeof(float)}, {WINED3DDECLTYPE_FLOAT4, 4, GL_FLOAT , GL_FALSE ,sizeof(float)},
{D3DDECLTYPE_D3DCOLOR, 4, GL_UNSIGNED_BYTE , GL_TRUE ,sizeof(BYTE)}, {WINED3DDECLTYPE_D3DCOLOR, 4, GL_UNSIGNED_BYTE , GL_TRUE ,sizeof(BYTE)},
{D3DDECLTYPE_UBYTE4, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)}, {WINED3DDECLTYPE_UBYTE4, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)},
{D3DDECLTYPE_SHORT2, 2, GL_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_SHORT2, 2, GL_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_SHORT4, 4, GL_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_SHORT4, 4, GL_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_UBYTE4N, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)}, {WINED3DDECLTYPE_UBYTE4N, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)},
{D3DDECLTYPE_SHORT2N, 2, GL_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_SHORT2N, 2, GL_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_SHORT4N, 4, GL_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_SHORT4N, 4, GL_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_USHORT2N, 2, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_USHORT2N, 2, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_DEC3N, 3, GL_SHORT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_DEC3N, 3, GL_SHORT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT , GL_FALSE ,sizeof(short int)}, {WINED3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT , GL_FALSE ,sizeof(short int)},
{D3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT , GL_FALSE ,sizeof(short int)}}; {WINED3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT , GL_FALSE ,sizeof(short int)}};
#define WINED3D_ATR_TYPE(type) glTypeLookup[type].d3dType #define WINED3D_ATR_TYPE(type) glTypeLookup[type].d3dType
#define WINED3D_ATR_SIZE(type) glTypeLookup[type].size #define WINED3D_ATR_SIZE(type) glTypeLookup[type].size
......
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