[WINED3D 1/10] D3DFORMAT: Consistently use WINED3D namespace.
Ivan Gyurdiev
ivg231 at gmail.com
Tue Oct 10 20:51:13 CDT 2006
-------------- next part --------------
---
dlls/wined3d/device.c | 10 +++---
dlls/wined3d/directx.c | 70 ++++++++++++++++++++--------------------
dlls/wined3d/surface.c | 2 +
dlls/wined3d/swapchain.c | 10 +++---
dlls/wined3d/utils.c | 8 ++---
dlls/wined3d/wined3d_private.h | 4 +-
6 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d1ecc14..268cb55 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1151,7 +1151,7 @@ static HRESULT WINAPI IWineD3DDeviceImp
/* 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
/* 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
/* 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_fbconfig
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,
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index b75ab29..9494b38 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1044,7 +1044,7 @@ static HMONITOR WINAPI IWineD3DImpl_GetA
/* 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 @@ #if !defined( DEBUG_SINGLE_MODE )
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 @@ #endif
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 @@ #if !defined( DEBUG_SINGLE_MODE )
/* 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 @@ #if !defined( DEBUG_SINGLE_MODE )
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 @@ #if !defined( DEBUG_SINGLE_MODE )
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 @@ #else
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_GetAd
}
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_Check
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_Check
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:
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index f139840..2873348 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -668,7 +668,7 @@ static HRESULT WINAPI IWineD3DSurfaceImp
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);
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index cf956d0..ccec8dc 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -505,13 +505,13 @@ static HRESULT WINAPI IWineD3DSwapChainI
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,
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index d829b4e..f3f7a1f 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -208,9 +208,9 @@ #undef FMT_TO_STR
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 *sma
#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 @@ #undef GLINFO_LOCATION
/* 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;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3a39bd0..765aea9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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,
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);
--
1.4.2.1
More information about the wine-patches
mailing list