[2/2] d3dx9: Remove some redundant and compiler-unfriendly pixel format checking code.
Matteo Bruni
matteo.mystral at gmail.com
Tue Apr 26 08:31:36 CDT 2011
Spotted by Gerald Pfeifer and Nicolas Le Cam, see
http://www.winehq.org/pipermail/wine-devel/2011-April/089576.html for
some discussion on this. Actually there is already a format check in
D3DXLoadSurfaceFromMemory, so no need to add another one.
-------------- next part --------------
From ad1acffe4053a255479d5f336df580df5b834e74 Mon Sep 17 00:00:00 2001
From: Matteo Bruni <mbruni at codeweavers.com>
Date: Tue, 5 Apr 2011 17:26:57 +0200
Subject: d3dx9: Remove some redundant and compiler-unfriendly pixel format checking code.
Spotted by Gerald Pfeifer and Nicolas Le Cam.
---
dlls/d3dx9_36/surface.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 1bc2d54..77cad08 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -702,13 +702,11 @@ static void copy_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsize,
for(x = 0;x < minwidth;x++) {
/* extract source color components */
- if(srcformat->type == FORMAT_ARGB) {
- pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel);
- get_relevant_argb_components(&conv_info, pixel, channels);
- }
+ pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel);
+ get_relevant_argb_components(&conv_info, pixel, channels);
/* recombine the components */
- if(destformat->type == FORMAT_ARGB) val = make_argb_color(&conv_info, channels);
+ val = make_argb_color(&conv_info, channels);
if(colorkey) {
get_relevant_argb_components(&ck_conv_info, pixel, channels);
@@ -769,13 +767,11 @@ static void point_filter_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsi
DWORD val = 0;
/* extract source color components */
- if(srcformat->type == FORMAT_ARGB) {
- pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel);
- get_relevant_argb_components(&conv_info, pixel, channels);
- }
+ pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel);
+ get_relevant_argb_components(&conv_info, pixel, channels);
/* recombine the components */
- if(destformat->type == FORMAT_ARGB) val = make_argb_color(&conv_info, channels);
+ val = make_argb_color(&conv_info, channels);
if(colorkey) {
get_relevant_argb_components(&ck_conv_info, pixel, channels);
--
1.7.3.4
More information about the wine-patches
mailing list