Commit 2bac4a02 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

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

parent 1cd7bcf4
...@@ -6141,7 +6141,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun ...@@ -6141,7 +6141,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
/***** /*****
* Drawing functions * 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) { UINT PrimitiveCount) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
...@@ -6159,7 +6159,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, D3 ...@@ -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 */ /* TODO: baseVIndex needs to be provided from This->stateBlock->baseVertexIndex when called from d3d8 */
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface, static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface,
D3DPRIMITIVETYPE PrimitiveType, WINED3DPRIMITIVETYPE PrimitiveType,
INT baseVIndex, UINT minIndex, INT baseVIndex, UINT minIndex,
UINT NumVertices, UINT startIndex, UINT primCount) { UINT NumVertices, UINT startIndex, UINT primCount) {
...@@ -6188,7 +6188,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice * ...@@ -6188,7 +6188,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *
return WINED3D_OK; 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 PrimitiveCount, CONST void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) { UINT VertexStreamZeroStride) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
...@@ -6218,7 +6218,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface, ...@@ -6218,7 +6218,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface,
return WINED3D_OK; 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 MinVertexIndex, UINT NumVertices,
UINT PrimitiveCount, CONST void* pIndexData, UINT PrimitiveCount, CONST void* pIndexData,
WINED3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData, WINED3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,
...@@ -6260,7 +6260,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice * ...@@ -6260,7 +6260,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
return WINED3D_OK; 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); drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0, 0, 0, 0, NULL, 0, DrawPrimStrideData);
return WINED3D_OK; return WINED3D_OK;
......
...@@ -39,44 +39,44 @@ extern IWineD3DPixelShaderImpl* PixelShaders[64]; ...@@ -39,44 +39,44 @@ extern IWineD3DPixelShaderImpl* PixelShaders[64];
#endif #endif
/* Issues the glBegin call for gl given the primitive type and count */ /* Issues the glBegin call for gl given the primitive type and count */
static DWORD primitiveToGl(D3DPRIMITIVETYPE PrimitiveType, static DWORD primitiveToGl(WINED3DPRIMITIVETYPE PrimitiveType,
DWORD NumPrimitives, DWORD NumPrimitives,
GLenum *primType) GLenum *primType)
{ {
DWORD NumVertexes = NumPrimitives; DWORD NumVertexes = NumPrimitives;
switch (PrimitiveType) { switch (PrimitiveType) {
case D3DPT_POINTLIST: case WINED3DPT_POINTLIST:
TRACE("POINTS\n"); TRACE("POINTS\n");
*primType = GL_POINTS; *primType = GL_POINTS;
NumVertexes = NumPrimitives; NumVertexes = NumPrimitives;
break; break;
case D3DPT_LINELIST: case WINED3DPT_LINELIST:
TRACE("LINES\n"); TRACE("LINES\n");
*primType = GL_LINES; *primType = GL_LINES;
NumVertexes = NumPrimitives * 2; NumVertexes = NumPrimitives * 2;
break; break;
case D3DPT_LINESTRIP: case WINED3DPT_LINESTRIP:
TRACE("LINE_STRIP\n"); TRACE("LINE_STRIP\n");
*primType = GL_LINE_STRIP; *primType = GL_LINE_STRIP;
NumVertexes = NumPrimitives + 1; NumVertexes = NumPrimitives + 1;
break; break;
case D3DPT_TRIANGLELIST: case WINED3DPT_TRIANGLELIST:
TRACE("TRIANGLES\n"); TRACE("TRIANGLES\n");
*primType = GL_TRIANGLES; *primType = GL_TRIANGLES;
NumVertexes = NumPrimitives * 3; NumVertexes = NumPrimitives * 3;
break; break;
case D3DPT_TRIANGLESTRIP: case WINED3DPT_TRIANGLESTRIP:
TRACE("TRIANGLE_STRIP\n"); TRACE("TRIANGLE_STRIP\n");
*primType = GL_TRIANGLE_STRIP; *primType = GL_TRIANGLE_STRIP;
NumVertexes = NumPrimitives + 2; NumVertexes = NumPrimitives + 2;
break; break;
case D3DPT_TRIANGLEFAN: case WINED3DPT_TRIANGLEFAN:
TRACE("TRIANGLE_FAN\n"); TRACE("TRIANGLE_FAN\n");
*primType = GL_TRIANGLE_FAN; *primType = GL_TRIANGLE_FAN;
NumVertexes = NumPrimitives + 2; NumVertexes = NumPrimitives + 2;
......
...@@ -355,18 +355,18 @@ const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res) { ...@@ -355,18 +355,18 @@ const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res) {
} }
} }
const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType) { const char* debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType) {
switch (PrimitiveType) { switch (PrimitiveType) {
#define PRIM_TO_STR(prim) case prim: return #prim; #define PRIM_TO_STR(prim) case prim: return #prim;
PRIM_TO_STR(D3DPT_POINTLIST); PRIM_TO_STR(WINED3DPT_POINTLIST);
PRIM_TO_STR(D3DPT_LINELIST); PRIM_TO_STR(WINED3DPT_LINELIST);
PRIM_TO_STR(D3DPT_LINESTRIP); PRIM_TO_STR(WINED3DPT_LINESTRIP);
PRIM_TO_STR(D3DPT_TRIANGLELIST); PRIM_TO_STR(WINED3DPT_TRIANGLELIST);
PRIM_TO_STR(D3DPT_TRIANGLESTRIP); PRIM_TO_STR(WINED3DPT_TRIANGLESTRIP);
PRIM_TO_STR(D3DPT_TRIANGLEFAN); PRIM_TO_STR(WINED3DPT_TRIANGLEFAN);
#undef PRIM_TO_STR #undef PRIM_TO_STR
default: default:
FIXME("Unrecognized %u D3DPRIMITIVETYPE!\n", PrimitiveType); FIXME("Unrecognized %u WINED3DPRIMITIVETYPE!\n", PrimitiveType);
return "unrecognized"; return "unrecognized";
} }
} }
......
...@@ -1252,7 +1252,7 @@ const char* debug_d3dusagequery(DWORD usagequery); ...@@ -1252,7 +1252,7 @@ const char* debug_d3dusagequery(DWORD usagequery);
const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method); const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method);
const char* debug_d3ddecltype(WINED3DDECLTYPE type); const char* debug_d3ddecltype(WINED3DDECLTYPE type);
const char* debug_d3ddeclusage(BYTE usage); 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_d3drenderstate(DWORD state);
const char* debug_d3dsamplerstate(DWORD state); const char* debug_d3dsamplerstate(DWORD state);
const char* debug_d3dtexturestate(DWORD state); const char* debug_d3dtexturestate(DWORD state);
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
# error You must include config.h to use this header # error You must include config.h to use this header
#endif #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) #if !defined( __WINE_DDRAW_H)
#error You must include ddraw.h to use this header #error You must include ddraw.h to use this header
#endif #endif
...@@ -448,11 +444,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) ...@@ -448,11 +444,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD(EndScene)(THIS) PURE; STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) 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(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(DrawPrimitive)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE;
STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,INT baseVIdx, UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; STDMETHOD(DrawIndexedPrimitive)(THIS_ WINED3DPRIMITIVETYPE 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(DrawPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE 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(DrawIndexedPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE 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(DrawPrimitiveStrided)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) PURE;
STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DRECTPATCH_INFO* pRectPatchInfo) 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(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DTRIPATCH_INFO* pTriPatchInfo) PURE;
STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
......
...@@ -41,6 +41,17 @@ typedef enum _WINED3DLIGHTTYPE { ...@@ -41,6 +41,17 @@ typedef enum _WINED3DLIGHTTYPE {
WINED3DLIGHT_FORCE_DWORD = 0x7fffffff WINED3DLIGHT_FORCE_DWORD = 0x7fffffff
} WINED3DLIGHTTYPE; } 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 { typedef struct _WINED3DCOLORVALUE {
float r; float r;
float g; float g;
......
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