d3dx9_36 [patch 2/2]: Add tests for D3DXCreateBox

David Adam david.adam.cnrs at gmail.com
Thu Mar 31 11:30:51 CDT 2011


2011/3/31 Matteo Bruni <matteo.mystral at gmail.com>

> 2011/3/31 David Adam <david.adam.cnrs at gmail.com>:
> >
> > +      /* Check the width */
> > +        v1 = *((D3DXVECTOR3*)(data+19*num_bytes_per_vertex));
> > +        v2 = *((D3DXVECTOR3*)(data+18*num_bytes_per_vertex));
> > +        length = D3DXVec3Length(D3DXVec3Subtract(&v2,&v1,&v2));
> > +        ok(fabs(length-10.0f)<admitted_error, "Width expected= 10.0,
> received %f\n", length);
>
> This is not really different from the previous version: you are still
> making assumptions about the vertex ordering (in this specific case,
> you're assuming that vertices 18 and 19 have different X coordinate
> but the same Y and Z coordinate values).
>

I have an application (Geoprofs) qui use the specific ordering of the
vertex. So if we implement randomly the vertex, it will not work.

>
> What I was proposing was something like this:
>
> for (i = 0; i < num_vertices; i++)
> {
>    float *vertex_data = data + i * num_bytes_per_vertex;
>    if (vertex_data[0] < xmin) xmin = vertex_data[0];
>    if (vertex_data[0] > xmax) xmax = vertex_data[0];
>    if (vertex_data[1] < ymin) ymin = vertex_data[1];
>    if (vertex_data[1] > ymax) ymax = vertex_data[1];
>    if (vertex_data[2] < zmin) zmin = vertex_data[2];
>    if (vertex_data[2] > zmax) zmax = vertex_data[2];
> }
>
> and then proceed to check whether the minimum and maximum values you
> got match the expected ones. This code snippet can certainly be
> improved, it is only to show you what I meant.
>
> Also, again, please try to fix the whitespaces...
>

People changed the original style of the file. So, Which one must I  keep ?

Thanks for your advices ;)

A+

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110331/644be892/attachment-0001.htm>


More information about the wine-devel mailing list