wined3d: Merge D3DPRIMITIVETYPE types into one type in WINED3D namespace.

This commit is contained in:
Ivan Gyurdiev 2006-10-12 02:23:55 -04:00 committed by Alexandre Julliard
parent 1cd7bcf4c8
commit 2bac4a02da
6 changed files with 37 additions and 30 deletions

View File

@ -6141,7 +6141,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
/*****
* Drawing functions
*****/
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex,
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType, UINT StartVertex,
UINT PrimitiveCount) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@ -6159,7 +6159,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, D3
/* TODO: baseVIndex needs to be provided from This->stateBlock->baseVertexIndex when called from d3d8 */
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface,
D3DPRIMITIVETYPE PrimitiveType,
WINED3DPRIMITIVETYPE PrimitiveType,
INT baseVIndex, UINT minIndex,
UINT NumVertices, UINT startIndex, UINT primCount) {
@ -6188,7 +6188,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface, D3DPRIMITIVETYPE PrimitiveType,
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType,
UINT PrimitiveCount, CONST void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@ -6218,7 +6218,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface,
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface, D3DPRIMITIVETYPE PrimitiveType,
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType,
UINT MinVertexIndex, UINT NumVertices,
UINT PrimitiveCount, CONST void* pIndexData,
WINED3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,
@ -6260,7 +6260,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided (IWineD3DDevice *iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) {
static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided (IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) {
drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0, 0, 0, 0, NULL, 0, DrawPrimStrideData);
return WINED3D_OK;

View File

@ -39,44 +39,44 @@ extern IWineD3DPixelShaderImpl* PixelShaders[64];
#endif
/* Issues the glBegin call for gl given the primitive type and count */
static DWORD primitiveToGl(D3DPRIMITIVETYPE PrimitiveType,
static DWORD primitiveToGl(WINED3DPRIMITIVETYPE PrimitiveType,
DWORD NumPrimitives,
GLenum *primType)
{
DWORD NumVertexes = NumPrimitives;
switch (PrimitiveType) {
case D3DPT_POINTLIST:
case WINED3DPT_POINTLIST:
TRACE("POINTS\n");
*primType = GL_POINTS;
NumVertexes = NumPrimitives;
break;
case D3DPT_LINELIST:
case WINED3DPT_LINELIST:
TRACE("LINES\n");
*primType = GL_LINES;
NumVertexes = NumPrimitives * 2;
break;
case D3DPT_LINESTRIP:
case WINED3DPT_LINESTRIP:
TRACE("LINE_STRIP\n");
*primType = GL_LINE_STRIP;
NumVertexes = NumPrimitives + 1;
break;
case D3DPT_TRIANGLELIST:
case WINED3DPT_TRIANGLELIST:
TRACE("TRIANGLES\n");
*primType = GL_TRIANGLES;
NumVertexes = NumPrimitives * 3;
break;
case D3DPT_TRIANGLESTRIP:
case WINED3DPT_TRIANGLESTRIP:
TRACE("TRIANGLE_STRIP\n");
*primType = GL_TRIANGLE_STRIP;
NumVertexes = NumPrimitives + 2;
break;
case D3DPT_TRIANGLEFAN:
case WINED3DPT_TRIANGLEFAN:
TRACE("TRIANGLE_FAN\n");
*primType = GL_TRIANGLE_FAN;
NumVertexes = NumPrimitives + 2;

View File

@ -355,18 +355,18 @@ const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res) {
}
}
const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType) {
const char* debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType) {
switch (PrimitiveType) {
#define PRIM_TO_STR(prim) case prim: return #prim;
PRIM_TO_STR(D3DPT_POINTLIST);
PRIM_TO_STR(D3DPT_LINELIST);
PRIM_TO_STR(D3DPT_LINESTRIP);
PRIM_TO_STR(D3DPT_TRIANGLELIST);
PRIM_TO_STR(D3DPT_TRIANGLESTRIP);
PRIM_TO_STR(D3DPT_TRIANGLEFAN);
PRIM_TO_STR(WINED3DPT_POINTLIST);
PRIM_TO_STR(WINED3DPT_LINELIST);
PRIM_TO_STR(WINED3DPT_LINESTRIP);
PRIM_TO_STR(WINED3DPT_TRIANGLELIST);
PRIM_TO_STR(WINED3DPT_TRIANGLESTRIP);
PRIM_TO_STR(WINED3DPT_TRIANGLEFAN);
#undef PRIM_TO_STR
default:
FIXME("Unrecognized %u D3DPRIMITIVETYPE!\n", PrimitiveType);
FIXME("Unrecognized %u WINED3DPRIMITIVETYPE!\n", PrimitiveType);
return "unrecognized";
}
}

View File

@ -1252,7 +1252,7 @@ const char* debug_d3dusagequery(DWORD usagequery);
const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method);
const char* debug_d3ddecltype(WINED3DDECLTYPE type);
const char* debug_d3ddeclusage(BYTE usage);
const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
const char* debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType);
const char* debug_d3drenderstate(DWORD state);
const char* debug_d3dsamplerstate(DWORD state);
const char* debug_d3dtexturestate(DWORD state);

View File

@ -28,10 +28,6 @@
# error You must include config.h to use this header
#endif
#if !defined( __WINE_D3D_H ) && !defined( __WINE_D3D8_H ) && !defined( __WINE_D3D9_H )
# error You must include d3d.h, d3d8.h or d3d9.h header to use this header
#endif
#if !defined( __WINE_DDRAW_H)
#error You must include ddraw.h to use this header
#endif
@ -448,11 +444,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
STDMETHOD(Clear)(THIS_ DWORD Count, CONST WINED3DRECT * pRects, DWORD Flags, WINED3DCOLOR Color, float Z, DWORD Stencil) PURE;
STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE;
STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,INT baseVIdx, UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE;
STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void * pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void * pIndexData,WINED3DFORMAT IndexDataFormat,CONST void * pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) PURE;
STDMETHOD(DrawPrimitive)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE;
STDMETHOD(DrawIndexedPrimitive)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, INT baseVIdx, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE;
STDMETHOD(DrawPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void * pIndexData, WINED3DFORMAT IndexDataFormat, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
STDMETHOD(DrawPrimitiveStrided)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) PURE;
STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DRECTPATCH_INFO* pRectPatchInfo) PURE;
STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DTRIPATCH_INFO* pTriPatchInfo) PURE;
STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;

View File

@ -41,6 +41,17 @@ typedef enum _WINED3DLIGHTTYPE {
WINED3DLIGHT_FORCE_DWORD = 0x7fffffff
} WINED3DLIGHTTYPE;
typedef enum _WINED3DPRIMITIVETYPE {
WINED3DPT_POINTLIST = 1,
WINED3DPT_LINELIST = 2,
WINED3DPT_LINESTRIP = 3,
WINED3DPT_TRIANGLELIST = 4,
WINED3DPT_TRIANGLESTRIP = 5,
WINED3DPT_TRIANGLEFAN = 6,
WINED3DPT_FORCE_DWORD = 0x7fffffff
} WINED3DPRIMITIVETYPE;
typedef struct _WINED3DCOLORVALUE {
float r;
float g;