wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs.
Henri Verbeet
hverbeet at codeweavers.com
Wed Dec 3 07:53:42 CST 2008
Also remove the silly typedef.
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/context.c | 2 +-
dlls/wined3d/device.c | 12 ++++++------
dlls/wined3d/directx.c | 14 +++++++-------
dlls/wined3d/state.c | 2 +-
dlls/wined3d/surface.c | 8 ++++----
dlls/wined3d/utils.c | 4 ++--
dlls/wined3d/volume.c | 2 +-
dlls/wined3d/wined3d_gl.h | 9 +--------
dlls/wined3d/wined3d_private.h | 15 ++++++++++++++-
10 files changed, 38 insertions(+), 32 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 9194673..051f71b 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -3690,7 +3690,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
float size[4] = {width, height, 1, 1};
struct arbfp_blit_priv *priv = (struct arbfp_blit_priv *) device->blit_priv;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(fmt, &GLINFO_LOCATION, &glDesc);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index acfe36b..05afe5d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1253,7 +1253,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
* the alpha blend state changes with different render target formats
*/
if(oldFmt != newFmt) {
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *old = getFormatDescEntry(oldFmt, NULL, NULL);
const StaticPixelFormatDesc *new = getFormatDescEntry(newFmt, &GLINFO_LOCATION, &glDesc);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 41b4861..b4c82ac 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -587,7 +587,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *object; /*NOTE: impl ref allowed since this is a create function */
unsigned int Size = 1;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *tableEntry = getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);
UINT mul_4w, mul_4h;
TRACE("(%p) Create surface\n",This);
@@ -759,7 +759,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
HRESULT hr;
unsigned int pow2Width;
unsigned int pow2Height;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);
TRACE("(%p) : Width %d, Height %d, Levels %d, Usage %#x\n", This, Width, Height, Levels, Usage);
@@ -911,7 +911,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
UINT tmpW;
UINT tmpH;
UINT tmpD;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);
@@ -1053,7 +1053,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
UINT tmpW;
HRESULT hr;
unsigned int pow2EdgeLength;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc);
/* TODO: It should only be possible to create textures for formats
@@ -5627,7 +5627,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *if
static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, DWORD* pNumPasses) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DBaseTextureImpl *texture;
- const GlPixelFormatDesc *gl_info;
+ const struct GlPixelFormatDesc *gl_info;
DWORD i;
TRACE("(%p) : %p\n", This, pNumPasses);
@@ -6762,7 +6762,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
This->cursorHeight = pSur->currentDesc.Height;
if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY)))
{
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *tableEntry = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &GLINFO_LOCATION, &glDesc);
char *mem, *bits = (char *)rect.pBits;
GLint intfmt = glDesc->glInternal;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 23a455c..d9b1c9d 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1811,7 +1811,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U
BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
IWineD3DImpl *This = (IWineD3DImpl *)iface;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc;
TRACE_(d3d_caps)("(%p)-> (Adptr:%d, DevType:(%x,%s), SurfFmt:(%x,%s), Win?%d, MultiSamp:%x, pQual:%p)\n",
@@ -1986,7 +1986,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter
static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT CheckFormat)
{
const struct fragment_pipeline *fp;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
switch(CheckFormat) {
case WINED3DFMT_V8U8:
@@ -2023,7 +2023,7 @@ static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE
static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayFormat, WINED3DFORMAT DepthStencilFormat)
{
int it=0;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc = getFormatDescEntry(DepthStencilFormat, &GLINFO_LOCATION, &glDesc);
/* Fail if we weren't able to get a description of the format */
@@ -2049,7 +2049,7 @@ static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayForma
static BOOL CheckFilterCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
{
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc);
/* Fail if we weren't able to get a description of the format */
@@ -2067,7 +2067,7 @@ static BOOL CheckFilterCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
static BOOL CheckRenderTargetCapability(WINED3DFORMAT AdapterFormat, WINED3DFORMAT CheckFormat)
{
UINT Adapter = 0;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc);
/* Fail if we weren't able to get a description of the format */
@@ -2174,7 +2174,7 @@ static BOOL CheckSrgbWriteCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WI
/* Check if a format support blending in combination with pixel shaders */
static BOOL CheckPostPixelShaderBlendingCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
{
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc);
/* Fail if we weren't able to get a description of the format */
@@ -2206,7 +2206,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE
{
const shader_backend_t *shader_backend;
const struct fragment_pipeline *fp;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
switch (CheckFormat) {
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 9e74d49..aa2795d 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -244,7 +244,7 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
if (stateblock->renderState[WINED3DRS_ALPHABLENDENABLE] ||
stateblock->renderState[WINED3DRS_EDGEANTIALIAS] ||
stateblock->renderState[WINED3DRS_ANTIALIASEDLINEENABLE]) {
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(target->resource.format, &GLINFO_LOCATION, &glDesc);
/* Disable blending in all cases even without pixelshaders. With blending on we could face a big performance penalty.
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 51fa5b5..12c1516 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -443,7 +443,7 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
}
if (!renderbuffer) {
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc);
GL_EXTCALL(glGenRenderbuffersEXT(1, &renderbuffer));
@@ -1528,7 +1528,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode) {
BOOL colorkey_active = need_alpha_ck && (This->CKeyFlags & WINEDDSD_CKSRCBLT);
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc);
@@ -2612,7 +2612,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, C
static HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
HRESULT hr;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc);
TRACE("(%p) : Calling base function first\n", This);
@@ -3889,7 +3889,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
/** Check against the maximum texture sizes supported by the video card **/
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
unsigned int pow2Width, pow2Height;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc);
/* Setup some glformat defaults */
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index e2dd859..c6a1ad4 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -466,7 +466,7 @@ void init_type_lookup(WineD3D_GL_Info *gl_info) {
#define GLINFO_LOCATION This->adapter->gl_info
const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info,
- const GlPixelFormatDesc **glDesc)
+ const struct GlPixelFormatDesc **glDesc)
{
int idx = getFmtIdx(fmt);
@@ -481,7 +481,7 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D
* all gl caps check return "unsupported" than catching the lack of gl all over the code. ANSI C requires
* static variables to be initialized to 0.
*/
- static const GlPixelFormatDesc dummyFmt;
+ static const struct GlPixelFormatDesc dummyFmt;
*glDesc = &dummyFmt;
} else {
*glDesc = &gl_info->gl_formats[idx];
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 0ab4b21..6700bb4 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -310,7 +310,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWi
static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int gl_level, BOOL srgb_mode) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
WINED3DFORMAT format = This->resource.format;
- const GlPixelFormatDesc *glDesc;
+ const struct GlPixelFormatDesc *glDesc;
getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc);
TRACE("(%p) : level %u, format %s (0x%08x)\n", This, gl_level, debug_d3dformat(format), format);
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index ff8f364..f92adc6 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -3813,13 +3813,6 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor
* Structures
****************************************************/
-typedef struct {
- GLint glInternal, glGammaInternal, rtInternal, glFormat, glType;
- WINED3DFORMAT conversion_group;
- unsigned int Flags;
- float heightscale;
-} GlPixelFormatDesc;
-
typedef struct _WINED3DGLTYPE {
int d3dType;
GLint size;
@@ -3889,7 +3882,7 @@ typedef struct _WineD3D_GL_Info {
/** OpenGL WGL functions ptr */
WGL_EXT_FUNCS_GEN
- GlPixelFormatDesc *gl_formats;
+ struct GlPixelFormatDesc *gl_formats;
/* Vertex data types */
WINED3DGLTYPE glTypeLookup[WINED3DDECLTYPE_UNUSED];
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2a6a064..d3ac5ca 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2378,6 +2378,19 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth);
/*****************************************************************************
* Pixel format management
*/
+
+struct GlPixelFormatDesc
+{
+ GLint glInternal;
+ GLint glGammaInternal;
+ GLint rtInternal;
+ GLint glFormat;
+ GLint glType;
+ WINED3DFORMAT conversion_group;
+ unsigned int Flags;
+ float heightscale;
+};
+
typedef struct {
WINED3DFORMAT format;
DWORD alphaMask, redMask, greenMask, blueMask;
@@ -2387,7 +2400,7 @@ typedef struct {
} StaticPixelFormatDesc;
const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt,
- const WineD3D_GL_Info *gl_info, const GlPixelFormatDesc **glDesc);
+ const WineD3D_GL_Info *gl_info, const struct GlPixelFormatDesc **glDesc);
static inline BOOL use_vs(IWineD3DDeviceImpl *device) {
return (device->vs_selected_mode != SHADER_NONE
--
1.5.6.4
--------------020107060004080302080700--
More information about the wine-patches
mailing list