d3d9/tests: Fix the Visual C++ double to float conversion warnings.

This commit is contained in:
Francois Gouget 2007-05-28 01:19:58 +02:00 committed by Alexandre Julliard
parent f64f30cdba
commit e6196f9ae7
2 changed files with 69 additions and 67 deletions

View File

@ -699,8 +699,9 @@ static void light_get_handler(
static const light_data light_poison_data = static const light_data light_poison_data =
{ { 0x1337c0de, { { 0x1337c0de,
{ 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 },
{ 3.3, 4.4, 5.5 }, { 6.6, 7.7, 8.8 }, { 3.3f, 4.4f, 5.5f },{ 6.6f, 7.7f, 8.8f },
12.12, 13.13, 14.14, 15.15, 16.16, 17.17, 18.18 }, 1, 0x1337c0de, 0x1337c0de }; 12.12f, 13.13f, 14.14f, 15.15f, 16.16f, 17.17f, 18.18f },
1, 0x1337c0de, 0x1337c0de };
static const light_data light_default_data = static const light_data light_default_data =
{ { D3DLIGHT_DIRECTIONAL, { { D3DLIGHT_DIRECTIONAL,
@ -713,8 +714,9 @@ static const light_data light_default_data =
static const light_data light_initial_data = static const light_data light_initial_data =
{ { 0x1337c0de, { { 0x1337c0de,
{ 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 }, { 7.0, 4.0, 2.0, 1.0 },
{ 3.3, 4.4, 5.5 }, { 6.6, 7.7, 8.8 }, { 3.3f, 4.4f, 5.5f }, { 6.6f, 7.7f, 8.8f },
12.12, 13.13, 14.14, 15.15, 16.16, 17.17, 18.18 }, 1, D3DERR_INVALIDCALL, D3DERR_INVALIDCALL }; 12.12f, 13.13f, 14.14f, 15.15f, 16.16f, 17.17f, 18.18f },
1, D3DERR_INVALIDCALL, D3DERR_INVALIDCALL };
static const light_data light_test_data_in = static const light_data light_test_data_in =
{ { 1, { { 1,
@ -869,43 +871,43 @@ static const transform_data transform_default_data = {
}; };
static const transform_data transform_poison_data = { static const transform_data transform_poison_data = {
{ { { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, { { { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 } } }, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f } } },
{ { { 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, { { { 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0 } } }, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f } } },
{ { { 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, { { { 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f,
41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0 } } }, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f } } },
{ { { 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, { { { 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f,
57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0 } } }, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f } } },
{ { { 64.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, { { { 64.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f,
73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 } } }, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f } } },
{ { { 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, { { { 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f,
89.0, 90.0, 91.0, 92.0, 93.0, 94.0, 95.0, 96.0} } }, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f} } },
}; };
static const transform_data transform_test_data = { static const transform_data transform_test_data = {
{ { { 1.2, 3.4, -5.6, 7.2, 10.11, -12.13, 14.15, -1.5, { { { 1.2f, 3.4f, -5.6f, 7.2f, 10.11f, -12.13f, 14.15f, -1.5f,
23.56, 12.89, 44.56, -1.0, 2.3, 0.0, 4.4, 5.5 } } }, 23.56f, 12.89f, 44.56f, -1.0f, 2.3f, 0.0f, 4.4f, 5.5f } } },
{ { { 9.2, 38.7, -6.6, 7.2, 10.11, -12.13, 77.15, -1.5, { { { 9.2f, 38.7f, -6.6f, 7.2f, 10.11f, -12.13f, 77.15f, -1.5f,
23.56, 12.89, 14.56, -1.0, 12.3, 0.0, 4.4, 5.5 } } }, 23.56f, 12.89f, 14.56f, -1.0f, 12.3f, 0.0f, 4.4f, 5.5f } } },
{ { { 10.2, 3.4, 0.6, 7.2, 10.11, -12.13, 14.15, -1.5, { { { 10.2f, 3.4f, 0.6f, 7.2f, 10.11f, -12.13f, 14.15f, -1.5f,
23.54, 12.9, 44.56, -1.0, 2.3, 0.0, 4.4, 5.5 } } }, 23.54f, 12.9f, 44.56f, -1.0f, 2.3f, 0.0f, 4.4f, 5.5f } } },
{ { { 1.2, 3.4, -5.6, 7.2, 10.11, -12.13, -14.5, -1.5, { { { 1.2f, 3.4f, -5.6f, 7.2f, 10.11f, -12.13f, -14.5f, -1.5f,
2.56, 12.89, 23.56, -1.0, 112.3, 0.0, 4.4, 2.5 } } }, 2.56f, 12.89f, 23.56f, -1.0f, 112.3f, 0.0f, 4.4f, 2.5f } } },
{ { { 1.2, 31.41, 58.6, 7.2, 10.11, -12.13, -14.5, -1.5, { { { 1.2f, 31.41f, 58.6f, 7.2f, 10.11f, -12.13f, -14.5f, -1.5f,
2.56, 12.89, 11.56, -1.0, 112.3, 0.0, 44.4, 2.5 } } }, 2.56f, 12.89f, 11.56f, -1.0f, 112.3f, 0.0f, 44.4f, 2.5f } } },
{ { { 1.20, 3.4, -5.6, 7.0, 10.11, -12.156, -14.5, -1.5, { { { 1.20f, 3.4f, -5.6f, 7.0f, 10.11f, -12.156f, -14.5f, -1.5f,
2.56, 1.829, 23.6, -1.0, 112.3, 0.0, 41.4, 2.5 } } }, 2.56f, 1.829f, 23.6f, -1.0f, 112.3f, 0.0f, 41.4f, 2.5f } } },
}; };
static HRESULT transform_setup_handler( static HRESULT transform_setup_handler(

View File

@ -143,38 +143,38 @@ static void lighting_test(IDirect3DDevice9 *device)
DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL;
DWORD color; DWORD color;
float mat[16] = { 1.0, 0.0, 0.0, 0.0, float mat[16] = { 1.0f, 0.0f, 0.0f, 0.0f,
0.0, 1.0, 0.0, 0.0, 0.0f, 1.0f, 0.0f, 0.0f,
0.0, 0.0, 1.0, 0.0, 0.0f, 0.0f, 1.0f, 0.0f,
0.0, 0.0, 0.0, 1.0 }; 0.0f, 0.0f, 0.0f, 1.0f };
struct vertex unlitquad[] = struct vertex unlitquad[] =
{ {
{-1.0, -1.0, 0.1, 0xffff0000}, {-1.0f, -1.0f, 0.1f, 0xffff0000},
{-1.0, 0.0, 0.1, 0xffff0000}, {-1.0f, 0.0f, 0.1f, 0xffff0000},
{ 0.0, 0.0, 0.1, 0xffff0000}, { 0.0f, 0.0f, 0.1f, 0xffff0000},
{ 0.0, -1.0, 0.1, 0xffff0000}, { 0.0f, -1.0f, 0.1f, 0xffff0000},
}; };
struct vertex litquad[] = struct vertex litquad[] =
{ {
{-1.0, 0.0, 0.1, 0xff00ff00}, {-1.0f, 0.0f, 0.1f, 0xff00ff00},
{-1.0, 1.0, 0.1, 0xff00ff00}, {-1.0f, 1.0f, 0.1f, 0xff00ff00},
{ 0.0, 1.0, 0.1, 0xff00ff00}, { 0.0f, 1.0f, 0.1f, 0xff00ff00},
{ 0.0, 0.0, 0.1, 0xff00ff00}, { 0.0f, 0.0f, 0.1f, 0xff00ff00},
}; };
struct nvertex unlitnquad[] = struct nvertex unlitnquad[] =
{ {
{ 0.0, -1.0, 0.1, 1.0, 1.0, 1.0, 0xff0000ff}, { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff},
{ 0.0, 0.0, 0.1, 1.0, 1.0, 1.0, 0xff0000ff}, { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff},
{ 1.0, 0.0, 0.1, 1.0, 1.0, 1.0, 0xff0000ff}, { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff},
{ 1.0, -1.0, 0.1, 1.0, 1.0, 1.0, 0xff0000ff}, { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff},
}; };
struct nvertex litnquad[] = struct nvertex litnquad[] =
{ {
{ 0.0, 0.0, 0.1, 1.0, 1.0, 1.0, 0xffffff00}, { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00},
{ 0.0, 1.0, 0.1, 1.0, 1.0, 1.0, 0xffffff00}, { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00},
{ 1.0, 1.0, 0.1, 1.0, 1.0, 1.0, 0xffffff00}, { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00},
{ 1.0, 0.0, 0.1, 1.0, 1.0, 1.0, 0xffffff00}, { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00},
}; };
WORD Indices[] = {0, 1, 2, 2, 3, 0}; WORD Indices[] = {0, 1, 2, 2, 3, 0};
@ -426,36 +426,36 @@ static void fog_test(IDirect3DDevice9 *device)
{ {
HRESULT hr; HRESULT hr;
DWORD color; DWORD color;
float start = 0.0, end = 1.0; float start = 0.0f, end = 1.0f;
/* Gets full z based fog with linear fog, no fog with specular color */ /* Gets full z based fog with linear fog, no fog with specular color */
struct sVertex unstransformed_1[] = { struct sVertex unstransformed_1[] = {
{-1, -1, 0.1, 0xFFFF0000, 0xFF000000 }, {-1, -1, 0.1f, 0xFFFF0000, 0xFF000000 },
{-1, 0, 0.1, 0xFFFF0000, 0xFF000000 }, {-1, 0, 0.1f, 0xFFFF0000, 0xFF000000 },
{ 0, 0, 0.1, 0xFFFF0000, 0xFF000000 }, { 0, 0, 0.1f, 0xFFFF0000, 0xFF000000 },
{ 0, -1, 0.1, 0xFFFF0000, 0xFF000000 }, { 0, -1, 0.1f, 0xFFFF0000, 0xFF000000 },
}; };
/* Ok, I am too lazy to deal with transform matrices */ /* Ok, I am too lazy to deal with transform matrices */
struct sVertex unstransformed_2[] = { struct sVertex unstransformed_2[] = {
{-1, 0, 1.0, 0xFFFF0000, 0xFF000000 }, {-1, 0, 1.0f, 0xFFFF0000, 0xFF000000 },
{-1, 1, 1.0, 0xFFFF0000, 0xFF000000 }, {-1, 1, 1.0f, 0xFFFF0000, 0xFF000000 },
{ 0, 1, 1.0, 0xFFFF0000, 0xFF000000 }, { 0, 1, 1.0f, 0xFFFF0000, 0xFF000000 },
{ 0, 0, 1.0, 0xFFFF0000, 0xFF000000 }, { 0, 0, 1.0f, 0xFFFF0000, 0xFF000000 },
}; };
/* Untransformed ones. Give them a different diffuse color to make the test look /* Untransformed ones. Give them a different diffuse color to make the test look
* nicer. It also makes making sure that they are drawn correctly easier. * nicer. It also makes making sure that they are drawn correctly easier.
*/ */
struct sVertexT transformed_1[] = { struct sVertexT transformed_1[] = {
{320, 0, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {320, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{640, 0, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {640, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{640, 240, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{320, 240, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
}; };
struct sVertexT transformed_2[] = { struct sVertexT transformed_2[] = {
{320, 240, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{640, 240, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{640, 480, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {640, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
{320, 480, 1.0, 1.0, 0xFFFFFF00, 0xFF000000 }, {320, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 },
}; };
WORD Indices[] = {0, 1, 2, 2, 3, 0}; WORD Indices[] = {0, 1, 2, 2, 3, 0};
@ -831,8 +831,8 @@ static void fog_with_shader_test(IDirect3DDevice9 *device)
}; };
/* NOTE: changing these values will not affect the tests with foggy vertex shader, as the values are hardcoded in the shader*/ /* NOTE: changing these values will not affect the tests with foggy vertex shader, as the values are hardcoded in the shader*/
start.f=0.9; start.f=0.9f;
end.f=0.1; end.f=0.1f;
hr = IDirect3DDevice9_CreateVertexShader(device, vertex_shader_code1, &vertex_shader[1]); hr = IDirect3DDevice9_CreateVertexShader(device, vertex_shader_code1, &vertex_shader[1]);
ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr); ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr);