d3dx9_36: Implement D3DXCreateBox

Joshua Beck jxb091000 at utdallas.edu
Sun Mar 27 16:52:52 CDT 2011


On 3/27/2011 11:08 AM, Joris Huizer wrote:
> But you are changing the values during the function:
>
> +
> +    for(i = 0; i<  24; i++)
> +    {
> +        vertices[6 * i    ] *= width;
> +        vertices[6 * i + 1] *= height;
> +        vertices[6 * i + 2] *= depth;
> +    }
> +

On a side note, you could rearrange this loop to use less multiplications:
+    for(i = 0; i<  24; i++)
+    {
+        int sixi = 6 * i;
+        vertices[sixi    ] *= width;
+        vertices[sixi + 1] *= height;
+        vertices[sixi + 2] *= depth;
+    }

Or even better:
+    for(i = 0; i<  144; i+=4)
+    {
+        vertices[i  ] *= width;
+        vertices[++i] *= height;
+        vertices[++i] *= depth;
+    }



More information about the wine-devel mailing list