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

wined3d: D3DFORMAT: Consistently use WINED3D namespace.

parent d642e114
......@@ -1151,7 +1151,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
/* TODO: It should only be possible to create textures for formats
that are reported as supported */
if (WINED3DFMT_UNKNOWN >= Format) {
WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This);
return WINED3DERR_INVALIDCALL;
}
......@@ -1237,7 +1237,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
/* TODO: It should only be possible to create textures for formats
that are reported as supported */
if (WINED3DFMT_UNKNOWN >= Format) {
WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This);
return WINED3DERR_INVALIDCALL;
}
......@@ -1338,7 +1338,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
/* TODO: It should only be possible to create textures for formats
that are reported as supported */
if (WINED3DFMT_UNKNOWN >= Format) {
WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This);
return WINED3DERR_INVALIDCALL;
}
......@@ -7375,8 +7375,8 @@ static GLXFBConfig* device_find_fbconfigs(
int nAttribs = 0;
IWineD3DSurface *StencilSurface = This->stencilBufferTarget;
D3DFORMAT BackBufferFormat = ((IWineD3DSurfaceImpl *) RenderSurface)->resource.format;
D3DFORMAT StencilBufferFormat = (NULL != StencilSurface) ? ((IWineD3DSurfaceImpl *) StencilSurface)->resource.format : 0;
WINED3DFORMAT BackBufferFormat = ((IWineD3DSurfaceImpl *) RenderSurface)->resource.format;
WINED3DFORMAT StencilBufferFormat = (NULL != StencilSurface) ? ((IWineD3DSurfaceImpl *) StencilSurface)->resource.format : 0;
/**TODO:
if StencilSurface == NULL && zBufferTarget != NULL then switch the zbuffer off,
......
......@@ -1044,7 +1044,7 @@ static HMONITOR WINAPI IWineD3DImpl_GetAdapterMonitor(IWineD3D *iface, UINT Adap
/* FIXME: GetAdapterModeCount and EnumAdapterModes currently only returns modes
of the same bpp but different resolutions */
/* Note: dx9 supplies a format. Calls from d3d8 supply D3DFMT_UNKNOWN */
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Adapter, WINED3DFORMAT Format) {
IWineD3DImpl *This = (IWineD3DImpl *)iface;
TRACE_(d3d_caps)("(%p}->(Adapter: %d, Format: %s)\n", This, Adapter, debug_d3dformat(Format));
......@@ -1068,17 +1068,17 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
j++;
switch (Format)
{
case D3DFMT_UNKNOWN:
case WINED3DFMT_UNKNOWN:
i++;
break;
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
case WINED3DFMT_X8R8G8B8:
case WINED3DFMT_A8R8G8B8:
if (min(DevModeW.dmBitsPerPel, bpp) == 32) i++;
if (min(DevModeW.dmBitsPerPel, bpp) == 24) i++;
break;
case D3DFMT_X1R5G5B5:
case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5:
case WINED3DFMT_X1R5G5B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_R5G6B5:
if (min(DevModeW.dmBitsPerPel, bpp) == 16) i++;
break;
default:
......@@ -1098,7 +1098,7 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
return 0;
}
/* Note: dx9 supplies a format. Calls from d3d8 supply D3DFMT_UNKNOWN */
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapter, WINED3DFORMAT Format, UINT Mode, WINED3DDISPLAYMODE* pMode) {
IWineD3DImpl *This = (IWineD3DImpl *)iface;
TRACE_(d3d_caps)("(%p}->(Adapter:%d, mode:%d, pMode:%p, format:%s)\n", This, Adapter, Mode, pMode, debug_d3dformat(Format));
......@@ -1123,7 +1123,7 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
/* If we are filtering to a specific format, then need to skip all unrelated
modes, but if mode is irrelevant, then we can use the index directly */
if (Format == D3DFMT_UNKNOWN)
if (Format == WINED3DFMT_UNKNOWN)
{
ModeIdx = Mode;
} else {
......@@ -1136,17 +1136,17 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
j++;
switch (Format)
{
case D3DFMT_UNKNOWN:
case WINED3DFMT_UNKNOWN:
i++;
break;
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
case WINED3DFMT_X8R8G8B8:
case WINED3DFMT_A8R8G8B8:
if (min(DevModeWtmp.dmBitsPerPel, bpp) == 32) i++;
if (min(DevModeWtmp.dmBitsPerPel, bpp) == 24) i++;
break;
case D3DFMT_X1R5G5B5:
case D3DFMT_A1R5G5B5:
case D3DFMT_R5G6B5:
case WINED3DFMT_X1R5G5B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_R5G6B5:
if (min(DevModeWtmp.dmBitsPerPel, bpp) == 16) i++;
break;
default:
......@@ -1169,14 +1169,14 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
pMode->RefreshRate = DevModeW.dmDisplayFrequency;
}
if (Format == D3DFMT_UNKNOWN)
if (Format == WINED3DFMT_UNKNOWN)
{
switch (bpp) {
case 8: pMode->Format = D3DFMT_R3G3B2; break;
case 16: pMode->Format = D3DFMT_R5G6B5; break;
case 8: pMode->Format = WINED3DFMT_R3G3B2; break;
case 16: pMode->Format = WINED3DFMT_R5G6B5; break;
case 24: /* Robots and EVE Online need 24 and 32 bit as A8R8G8B8 to start */
case 32: pMode->Format = D3DFMT_A8R8G8B8; break;
default: pMode->Format = D3DFMT_UNKNOWN;
case 32: pMode->Format = WINED3DFMT_A8R8G8B8; break;
default: pMode->Format = WINED3DFMT_UNKNOWN;
}
} else {
pMode->Format = Format;
......@@ -1194,7 +1194,7 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
pMode->Width = 800;
pMode->Height = 600;
pMode->RefreshRate = D3DADAPTER_DEFAULT;
pMode->Format = (Format == D3DFMT_UNKNOWN) ? D3DFMT_A8R8G8B8 : Format;
pMode->Format = (Format == WINED3DFMT_UNKNOWN) ? WINED3DFMT_A8R8G8B8 : Format;
bpp = 32;
#endif
TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height,
......@@ -1231,11 +1231,11 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayMode(IWineD3D *iface, UINT A
}
switch (bpp) {
case 8: pMode->Format = D3DFMT_R3G3B2; break;
case 16: pMode->Format = D3DFMT_R5G6B5; break;
case 24: pMode->Format = D3DFMT_X8R8G8B8; break; /* Robots needs 24bit to be X8R8G8B8 */
case 32: pMode->Format = D3DFMT_X8R8G8B8; break; /* EVE online and the Fur demo need 32bit AdapterDisplatMode to return X8R8G8B8 */
default: pMode->Format = D3DFMT_UNKNOWN;
case 8: pMode->Format = WINED3DFMT_R3G3B2; break;
case 16: pMode->Format = WINED3DFMT_R5G6B5; break;
case 24: pMode->Format = WINED3DFMT_X8R8G8B8; break; /* Robots needs 24bit to be X8R8G8B8 */
case 32: pMode->Format = WINED3DFMT_X8R8G8B8; break; /* EVE online and the Fur demo need 32bit AdapterDisplatMode to return X8R8G8B8 */
default: pMode->Format = WINED3DFMT_UNKNOWN;
}
} else {
......@@ -1656,11 +1656,11 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
switch (CheckFormat) {
case D3DFMT_DXT1:
case D3DFMT_DXT2:
case D3DFMT_DXT3:
case D3DFMT_DXT4:
case D3DFMT_DXT5:
case WINED3DFMT_DXT1:
case WINED3DFMT_DXT2:
case WINED3DFMT_DXT3:
case WINED3DFMT_DXT4:
case WINED3DFMT_DXT5:
TRACE_(d3d_caps)("[OK]\n");
return WINED3D_OK;
default:
......@@ -1673,11 +1673,11 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
BOOL half_pixel_support = GL_SUPPORT(ARB_HALF_FLOAT_PIXEL);
switch (CheckFormat) {
case D3DFMT_R16F:
case D3DFMT_A16B16G16R16F:
case WINED3DFMT_R16F:
case WINED3DFMT_A16B16G16R16F:
if (!half_pixel_support) break;
case D3DFMT_R32F:
case D3DFMT_A32B32G32R32F:
case WINED3DFMT_R32F:
case WINED3DFMT_A32B32G32R32F:
TRACE_(d3d_caps)("[OK]\n");
return WINED3D_OK;
default:
......
......@@ -668,7 +668,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
if (NULL == pRect) {
pLockedRect->pBits = This->resource.allocatedMemory;
} else{
if (This->resource.format == D3DFMT_DXT1) { /* DXT1 is half byte per pixel */
if (This->resource.format == WINED3DFMT_DXT1) { /* DXT1 is half byte per pixel */
pLockedRect->pBits = This->resource.allocatedMemory + (pLockedRect->Pitch * pRect->top) + ((pRect->left * This->bytesPerPixel / 2));
} else {
pLockedRect->pBits = This->resource.allocatedMemory + (pLockedRect->Pitch * pRect->top) + (pRect->left * This->bytesPerPixel);
......
......@@ -505,13 +505,13 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *if
DeleteDC(hdc);
switch (bpp) {
case 8: pMode->Format = D3DFMT_R8G8B8; break;
case 16: pMode->Format = D3DFMT_R5G6B5; break;
case 24: /*pMode->Format = D3DFMT_R8G8B8; break; */ /* 32bpp and 24bpp can be aliased for X */
case 32: pMode->Format = D3DFMT_A8R8G8B8; break;
case 8: pMode->Format = WINED3DFMT_R8G8B8; break;
case 16: pMode->Format = WINED3DFMT_R5G6B5; break;
case 24: /*pMode->Format = WINED3DFMT_R8G8B8; break; */ /* 32bpp and 24bpp can be aliased for X */
case 32: pMode->Format = WINED3DFMT_A8R8G8B8; break;
default:
FIXME("Unrecognized display mode format\n");
pMode->Format = D3DFMT_UNKNOWN;
pMode->Format = WINED3DFMT_UNKNOWN;
}
TRACE("(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)\n", This, pMode->Width, pMode->Height, pMode->RefreshRate,
......
......@@ -208,9 +208,9 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
fourcc[3] = (char)(fmt >> 24);
fourcc[4] = 0;
if( isprint(fourcc[0]) && isprint(fourcc[1]) && isprint(fourcc[2]) && isprint(fourcc[3]) )
FIXME("Unrecognized %u (as fourcc: %s) D3DFORMAT!\n", fmt, fourcc);
FIXME("Unrecognized %u (as fourcc: %s) WINED3DFORMAT!\n", fmt, fourcc);
else
FIXME("Unrecognized %u D3DFORMAT!\n", fmt);
FIXME("Unrecognized %u WINED3DFORMAT!\n", fmt);
}
return "unrecognized";
}
......@@ -2271,7 +2271,7 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords)
#define GLINFO_LOCATION ((IWineD3DImpl *)(This->wineD3D))->gl_info
/* Convertes a D3D format into a OpenGL configuration format */
int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate){
int D3DFmtMakeGlCfg(WINED3DFORMAT BackBufferFormat, WINED3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate){
#define PUSH1(att) attribs[(*nAttribs)++] = (att);
#define PUSH2(att,value) attribs[(*nAttribs)++] = (att); attribs[(*nAttribs)++] = (value);
/*We need to do some Card specific stuff in here at some point,
......@@ -2441,7 +2441,7 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
/* DirectDraw stuff */
WINED3DFORMAT pixelformat_for_depth(DWORD depth) {
switch(depth) {
case 8: return D3DFMT_P8; break;
case 8: return WINED3DFMT_P8; break;
case 15: return WINED3DFMT_X1R5G5B5; break;
case 16: return WINED3DFMT_R5G6B5; break;
case 24: return WINED3DFMT_R8G8B8; break;
......
......@@ -727,7 +727,7 @@ typedef struct IWineD3DBaseTextureClass
{
UINT levels;
BOOL dirty;
D3DFORMAT format;
WINED3DFORMAT format;
DWORD usage;
UINT textureName;
UINT LOD;
......@@ -1266,7 +1266,7 @@ void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, D3DTEXTUREOP o
void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx);
void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords);
int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate);
int D3DFmtMakeGlCfg(WINED3DFORMAT BackBufferFormat, WINED3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate);
/* Math utils */
void multiply_matrix(D3DMATRIX *dest, D3DMATRIX *src1, D3DMATRIX *src2);
......
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