From 20b147bfebbe46997fc0809de9086ab5a5d51abf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Thu, 12 May 2011 21:05:29 +0200 Subject: [PATCH] wined3d: Consistently store format bitcounts in BYTEs. --- dlls/wined3d/context.c | 6 +++--- dlls/wined3d/directx.c | 10 +++++----- dlls/wined3d/utils.c | 6 +++--- dlls/wined3d/wined3d_private.h | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 99f189b8ac4..5d417b18ac5 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1177,8 +1177,8 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, { int iPixelFormat=0; unsigned int matchtry; - short redBits, greenBits, blueBits, alphaBits, colorBits; - short depthBits=0, stencilBits=0; + BYTE redBits, greenBits, blueBits, alphaBits, colorBits; + BYTE depthBits=0, stencilBits=0; static const struct { @@ -2052,7 +2052,7 @@ static inline void context_set_render_offscreen(struct wined3d_context *context, static BOOL match_depth_stencil_format(const struct wined3d_format *existing, const struct wined3d_format *required) { - short existing_depth, existing_stencil, required_depth, required_stencil; + BYTE existing_depth, existing_stencil, required_depth, required_stencil; if (existing == required) return TRUE; if ((existing->flags & WINED3DFMT_FLAG_FLOAT) != (required->flags & WINED3DFMT_FLAG_FLOAT)) return FALSE; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 7951d0219d5..4dff331f2e1 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2934,7 +2934,7 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format) { - short redSize, greenSize, blueSize, alphaSize, colorBits; + BYTE redSize, greenSize, blueSize, alphaSize, colorBits; if(!cfg) return FALSE; @@ -2971,7 +2971,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const struct wined static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format) { - short depthSize, stencilSize; + BYTE depthSize, stencilSize; BOOL lockable = FALSE; if(!cfg) @@ -3117,7 +3117,7 @@ HRESULT CDECL wined3d_check_device_multisample_type(const struct wined3d *wined3 } else if (format->flags & WINED3DFMT_FLAG_RENDERTARGET) { - short redSize, greenSize, blueSize, alphaSize, colorBits; + BYTE redSize, greenSize, blueSize, alphaSize, colorBits; const struct wined3d_pixel_format *cfgs; unsigned int i, cfg_count; @@ -3217,8 +3217,8 @@ static BOOL CheckRenderTargetCapability(const struct wined3d_adapter *adapter, if (!(check_format->flags & WINED3DFMT_FLAG_RENDERTARGET)) return FALSE; if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) { - short AdapterRed, AdapterGreen, AdapterBlue, AdapterAlpha, AdapterTotalSize; - short CheckRed, CheckGreen, CheckBlue, CheckAlpha, CheckTotalSize; + BYTE AdapterRed, AdapterGreen, AdapterBlue, AdapterAlpha, AdapterTotalSize; + BYTE CheckRed, CheckGreen, CheckBlue, CheckAlpha, CheckTotalSize; const struct wined3d_pixel_format *cfgs = adapter->cfgs; int it; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index c22cdd97220..0df2c9e6e16 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -34,7 +34,7 @@ struct StaticPixelFormatDesc enum wined3d_format_id id; DWORD alphaMask, redMask, greenMask, blueMask; UINT bpp; - short depthSize, stencilSize; + BYTE depthSize, stencilSize; }; /***************************************************************************** @@ -2535,7 +2535,7 @@ unsigned int count_bits(unsigned int mask) /* Helper function for retrieving color info for ChoosePixelFormat and wglChoosePixelFormatARB. * The later function requires individual color components. */ BOOL getColorBits(const struct wined3d_format *format, - short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) + BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) { TRACE("format %s.\n", debug_d3dformat(format->id)); @@ -2573,7 +2573,7 @@ BOOL getColorBits(const struct wined3d_format *format, } /* Helper function for retrieving depth/stencil info for ChoosePixelFormat and wglChoosePixelFormatARB */ -BOOL getDepthStencilBits(const struct wined3d_format *format, short *depthSize, short *stencilSize) +BOOL getDepthStencilBits(const struct wined3d_format *format, BYTE *depthSize, BYTE *stencilSize) { TRACE("format %s.\n", debug_d3dformat(format->id)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f076748b1bf..c599af0dd73 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2540,9 +2540,9 @@ void state_fog_fragpart(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) DECLSPEC_HIDDEN; BOOL getColorBits(const struct wined3d_format *format, - short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) DECLSPEC_HIDDEN; + BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) DECLSPEC_HIDDEN; BOOL getDepthStencilBits(const struct wined3d_format *format, - short *depthSize, short *stencilSize) DECLSPEC_HIDDEN; + BYTE *depthSize, BYTE *stencilSize) DECLSPEC_HIDDEN; /* Math utils */ void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2) DECLSPEC_HIDDEN; @@ -2812,8 +2812,8 @@ struct wined3d_format DWORD blue_mask; DWORD alpha_mask; UINT byte_count; - WORD depth_size; - WORD stencil_size; + BYTE depth_size; + BYTE stencil_size; UINT block_width; UINT block_height; -- 2.11.4.GIT