From 0657e8d87a6e5efb4b036a6daa2d79084c9e0d12 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 31 Dec 2008 16:57:10 +0100 Subject: [PATCH] wined3d: Use slightly nicer loops in device_map_fixed_function_samplers(). --- dlls/wined3d/device.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 06698f59d62..64dd866a323 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3671,13 +3671,16 @@ static void device_update_fixed_function_usage_map(IWineD3DDeviceImpl *This) { static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) { int i, tex; + WORD ffu_map; device_update_fixed_function_usage_map(This); + ffu_map = This->fixed_function_usage_map; if (This->max_ffp_textures == This->max_ffp_texture_stages || - This->stateBlock->lowest_disabled_stage <= This->max_ffp_textures) { - for (i = 0; i < This->stateBlock->lowest_disabled_stage; ++i) { - if (!(This->fixed_function_usage_map & (1 << i))) continue; + This->stateBlock->lowest_disabled_stage <= This->max_ffp_textures) { + for (i = 0; ffu_map; ffu_map >>= 1, ++i) + { + if (!(ffu_map & 1)) continue; if (This->texUnitMap[i] != i) { device_map_stage(This, i, i); @@ -3690,8 +3693,9 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) { /* Now work out the mapping */ tex = 0; - for (i = 0; i < This->stateBlock->lowest_disabled_stage; ++i) { - if (!(This->fixed_function_usage_map & (1 << i))) continue; + for (i = 0; ffu_map; ffu_map >>= 1, ++i) + { + if (!(ffu_map & 1)) continue; if (This->texUnitMap[i] != tex) { device_map_stage(This, i, tex);