On 03/27/2011 04:52 PM, Joshua Beck wrote:
> 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]
Joshua Beck wrote:
> >> Or even better:
> >> +for(i = 0; i< 144; i+=4)
> >> +{
> >> +vertices[i ] *= width;
> >> +vertices[++i] *= height;
> >> +vertices[++i] *= depth;
> >> +}
> >>
> > There shouild be i + 1 and i + 2 instead of two ++i otherwise
> >
On 03/27/2011 10:58 PM, Dmitry Timoshkov wrote:
Joshua Beck wrote:
Or even better:
+for(i = 0; i< 144; i+=4)
+{
+vertices[i ] *= width;
+vertices[++i] *= height;
+vertices[++i] *= depth;
+}
There shouild be i + 1 and i + 2 instead of two ++i ot
Joshua Beck wrote:
> Or even better:
> +for(i = 0; i< 144; i+=4)
> +{
> +vertices[i ] *= width;
> +vertices[++i] *= height;
> +vertices[++i] *= depth;
> +}
There shouild be i + 1 and i + 2 instead of two ++i otherwise
the loop index gets corrupted.
--
Dmit
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 rearran
Hello,
In this patch, one part seemed strange to me:
You are declaring vertices as static memory:
+static FLOAT vertices[144]
But you are changing the values during the function:
+
+for(i = 0; i< 24; i++)
+{
+vertices[6 * i] *= width;
+vertices[6 * i + 1] *= he