From ee5e469fd82e57eeba408edd204c929e42d4981a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 15 Jul 2014 08:43:54 +0200 Subject: [PATCH] ddraw/tests: Get rid of struct sVertex. --- dlls/ddraw/tests/visual.c | 64 ++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index e517d644397..58c7d7d57d9 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -446,12 +446,6 @@ static void clear_test(IDirect3DDevice7 *device) ok(color == 0x00ffffff, "Clear rectangle 4(neg, neg) has color %08x\n", color); } -struct sVertex { - float x, y, z; - DWORD diffuse; - DWORD specular; -}; - struct sVertexT { float x, y, z, rhw; DWORD diffuse; @@ -465,19 +459,41 @@ static void fog_test(IDirect3DDevice7 *device) float start = 0.0, end = 1.0; D3DDEVICEDESC7 caps; + struct + { + struct vec3 position; + DWORD diffuse; + DWORD specular; + } /* Gets full z based fog with linear fog, no fog with specular color */ - struct sVertex untransformed_1[] = { - {-1, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - {-1, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - }; + untransformed_1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000, 0xff000000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000, 0xff000000}, + }, /* Ok, I am too lazy to deal with transform matrices */ - struct sVertex untransformed_2[] = { - {-1, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, - {-1, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, + untransformed_2[] = + { + {{-1.0f, 0.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{-1.0f, 1.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 1.0f, 1.0f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 1.0f}, 0xffff0000, 0xff000000}, + }, + far_quad1[] = + { + {{-1.0f, -1.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{-1.0f, 0.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 0.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, -1.0f, 0.5f}, 0xffff0000, 0xff000000}, + }, + far_quad2[] = + { + {{-1.0f, 0.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{-1.0f, 1.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 1.0f, 1.5f}, 0xffff0000, 0xff000000}, + {{ 0.0f, 0.0f, 1.5f}, 0xffff0000, 0xff000000}, }; /* 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. @@ -523,20 +539,6 @@ static void fog_test(IDirect3DDevice7 *device) 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, }; - struct sVertex far_quad1[] = - { - {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - }; - struct sVertex far_quad2[] = - { - {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - }; memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice7_GetCaps(device, &caps);