Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Andrew Nguyen
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]

Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Dmitry Timoshkov
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 > >

Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Joshua Beck
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

Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Dmitry Timoshkov
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

Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Joshua Beck
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

Re: d3dx9_36: Implement D3DXCreateBox

2011-03-27 Thread Joris Huizer
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