[Bug 22918] Ship Simulator 2008 demo crashes on startup (needs D3DXCreateSphere, D3DXCreateCylinder, and D3DXCreateTeapot)

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Jul 16 04:26:04 CDT 2010


http://bugs.winehq.org/show_bug.cgi?id=22918





--- Comment #13 from Henri Verbeet <hverbeet at gmail.com>  2010-07-16 04:26:03 ---
(In reply to comment #12)
> D3DXCreateCylinder done:
> http://github.com/misha680/wine/commit/2900a9cb2aad27c96e4100c6e741466c362cdae2
> 
I quickly looked it over, and I've got a couple of points:

- In the expression "sqrt(normal.x * normal.x + normal.y * normal.y) *
delta_radius / length;", "sqrt(normal.x * normal.x + normal.y * normal.y)"
should be equal to "radius", and "delta_radius / length" is constant for a
given cylinder. I.e., conceptually you have "radius * normal_slope".
- The code would probably benefit from having a proper structure for the vertex
data. E.g.:

struct vertex_data
{
    D3DXVECTOR3 position;
    D3DXVECTOR3 normal;
};

- The caps calculations look a bit forced into the main loop. The code will
probably be clearer if you simply calculate those outside the main loop, like
you do for indices. Also, note that you can easily define a helper function to
generate a ring of vertices with a certain radius, z position and z normal.
- "radius_step = (radius2 - radius1) / stacks;" can be simplified to
"radius_step = -delta_radius / stacks;". Perhaps it's just as easy to just
define it as "delta_radius / stacks" and change "radius += radius_step;" to
"radius -= radius_step;" though.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list