ew_static.c
3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**************************************************************************
* *
* Copyright (C) 1995, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/*
* File: ew_static.c
* Creator: hal@sgi.com
* Create Date: Tue Sep 26 14:01:01 PDT 1995
* Purpose:
*
* This file holds tiny display list segments that are 'static' data, for use
* by the edge walker test module in ew.c
*
* If you feel the urge to modify a test, see the comment at
* the top of main.c for details.
*/
#include <ultratypes.h>
#include <mbi.h>
#include "rdpvector.h"
/*
* Test conventions:
*
* Data variable names can be about anything, as long as they are unique
* and consistent in the table entry.
*
* In order to get around compiler weirdness, the table of tests
* is in ew.c, and the Gfx lists must be extern'd in rdpvector.h
*
* Your test case display list must end with gsSPEndDisplayList(),
* otherwise there are length hassles.
*
* Your test case should set any special mode you want (texture, zbuff,
* etc.) and also turn it off when you are done, so as not to affect
* other tests.
*
*/
/*
* Test -1, default frame. Used as a placeholder.
*
* Simple square (4 triangles), each vertex a different color.
*
* Wed Oct 5 22:12:43 PDT 1994
*
*/
static Vtx ew_place_vtx[5] = {
/* x, y, z, flag, s, t, r, g, b, a */
{ -40, 40, 0, 0, 0, 0, 0xff, 0, 0, 0xff }, /* R */
{ 40, 40, 0, 0, 0, 0, 0, 0xff, 0, 0xff }, /* G */
{ 40, -40, 0, 0, 0, 0, 0, 0, 0xff, 0xff }, /* B */
{ -40, -40, 0, 0, 0, 0, 0xff, 0xff, 0, 0xff }, /* Y */
{ 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff }, /* W */
};
Gfx EW_placebo_dl[MAX_STATIC_GFX_SIZE] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER),
gsSPSetGeometryMode(G_SHADE),
gsDPSetCombineMode (G_CC_SHADE, G_CC_SHADE),
gsSPVertex(&ew_place_vtx, 5, 0),
gsSP1Triangle(0, 4, 1, 0),
gsSP1Triangle(1, 4, 2, 0),
gsSP1Triangle(2, 4, 3, 0),
gsSP1Triangle(3, 4, 0, 0),
gsSPEndDisplayList(),
};
/* end of case -1 */
/*
* TO ADD A TEST CASE:
* Put data and display list for the new case above here:
*
* The Gfx display list must be extern'd in ew.h, then
* added to the 'testList_ew' table in ew.c as a Gfx pointer field of a
* GfxTest_t struct. You must also decide whether the existing top level DL's
* will suffice for your application (you may need to provide a new top level
* DL of your own design in toplevel.c).
*
*/