Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
dynlist_macros.h
Go to the documentation of this file.
1 #ifndef _DYN_LIST_MACROS_H_
2 #define _DYN_LIST_MACROS_H_
3 
4 /* DynListCmd Macros */
5 /* Necessary start command for the dynlist. List will not process otherwise. */
6 #define StartList() \
7  { 53716, {0}, {0}, {0.0, 0.0, 0.0} }
8 
9 /* Necessary stop command for the dynlist. */
10 #define StopList() \
11  { 58, {0}, {0}, {0.0, 0.0, 0.0} }
12 
13 /* Subsequent dynobj ids should be treated as ints, not as C string pointers. */
14 #define UseIntId(w2) \
15  { 0, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
16 
17 /* Set the initial position of the current object */
18 /* Supported Objs: joints, particles, nets, vertices, cameras */
19 #define SetInitialPosition(x, y, z) \
20  { 1, {0}, {0}, {(x), (y), (z)} }
21 
22 /* Set the relative position of the current object */
23 /* Supported Objs: joints, particles, vertices, cameras, labels */
24 #define SetRelativePosition(x, y, z) \
25  { 2, {0}, {0}, {(x), (y), (z)} }
26 
27 /* Set the world position of the current object */
28 /* Supported Objs: joints, nets, vertices, cameras, gadgets, views */
29 #define SetWorldPosition(x, y, z) \
30  { 3, {0}, {0}, {(x), (y), (z)} }
31 
32 /* Set the normal of the current object */
33 /* Supported Objs: vertices */
34 #define SetNormal(x, y, z) \
35  { 4, {0}, {0}, {(x), (y), (z)} }
36 
37 /* Set the scale of the current object */
38 /* Supported Objs: joints, particles, nets, gadgets, views, lights */
39 #define SetScale(x, y, z) \
40  { 5, {0}, {0}, {(x), (y), (z)} }
41 
42 /* Set the rotation of the current object */
43 /* Supported Objs: joints, nets */
44 #define SetRotation(x, y, z) \
45  { 6, {0}, {0}, {(x), (y), (z)} }
46 
47 /* Set the half-word flag in the header of the current dynobj */
48 /* Supported Objs: all */
49 #define SetHeaderFlag(w2) \
50  { 7, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
51 
52 /* Set the bits in an object specific flag with the provided flag */
53 /* Supported Objs: bones, joints, particles, shapes, nets, cameras, views, lights */
54 #define SetFlag(w2) \
55  { 8, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
56 
57 /* Clear the bits in an object specific flag with the provided flag */
58 /* Supported Objs: bones, joints, particles, nets, cameras */
59 #define ClearFlag(w2) \
60  { 9, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
61 
62 /* Set the friction vector of a Joint */
63 /* Supported Objs: joints */
64 #define SetFriction(x, y, z) \
65  { 10, {0}, {0}, {(x), (y), (z)} }
66 
67 /* Set the spring f32 of a Bone */
68 /* Supported Objs: bones */
69 #define SetSpring(x) \
70  { 11, {0}, {0}, {(x), 0.0, 0.0} }
71 
72 /* Jump to pointed dynlist. Once that list has finished processing, flow returns to current list. */
73 #define JumpToList(w1) \
74  { 12, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
75 
76 /* Store either the enumerated "colour" number in an object, or the RGB f32 values the number refers to */
77 /* Supported Objs: joints, particles, nets, faces, gadgets */
78 #define SetColourNum(w2) \
79  { 13, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
80 
81 /* Make an object of the specified type and id, and add that object to the dynobj pool. */
82 #define MakeDynObj(w2, w1) \
83  { 15, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
84 
85 /* Make a group object that will contain all subsequently created objects once the EndGroup command is called. */
86 #define StartGroup(w1) \
87  { 16, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
88 
89 /* Collect all objects created after the StartGroup command with the same id. */
90 /* Supported Objs: groups */
91 #define EndGroup(w1) \
92  { 17, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
93 
94 /* Add the current dyn object to the Group with the called ID */
95 /* Supported Objs: groups */
96 #define AddToGroup(w1) \
97  { 18, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
98 
99 /* Set an object specific type flag. */
100 /* Supported Objs: groups, joints, particles, nets, materials, gadgets */
101 #define SetType(w2) \
102  { 19, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
103 
104 /* Assign the material Group ID to the current dynobj Shape and check the Shape */
105 /* Supported Objs: shapes */
106 #define SetMaterialGroup(w1) \
107  { 20, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
108 
109 /* Attach Group ID to the current dynobj */
110 /* Supported Objs: shapes, nets, gadgets, animators */
111 #define SetNodeGroup(w1) \
112  { 21, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
113 
114 /* Set the skin group of the current Net dynobj with the vertices from Shape ID */
115 /* Supported Objs: nets */
116 #define SetSkinShape(w1) \
117  { 22, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
118 
119 /* Set the plane group ID of the current dynobj */
120 /* Supported Objs: shapes, nets */
121 #define SetPlaneGroup(w1) \
122  { 23, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
123 
124 /* Set the current dynobj's shape pointer by dereferencing the ptr ptr */
125 /* Supported Objs: bones, joints, particles, nets, gadgets, lights */
126 #define SetShapePtrPtr(w1) \
127  { 24, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
128 
129 /* Set the current dynobj's shape pointer to Shape ID */
130 /* Supported Objs: bones, joints, particles, nets, gadgets */
131 #define SetShapePtr(w1) \
132  { 25, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
133 
134 /* Set offset of the connected shape */
135 /* Supported Objs: joints */
136 #define SetShapeOffset(x, y, z) \
137  { 26, {0}, {0}, {(x), (y), (z)} }
138 
139 /* Set the center of gravity of the current Net object */
140 /* Supported Objs: nets */
141 #define SetCenterOfGravity(x, y, z) \
142  { 27, {0}, {0}, {(x), (y), (z)} }
143 
144 /* Link Object ID to the current dynobj */
145 /* Supported Objs: groups, bones, faces, cameras, views, labels, animators */
146 #define LinkWith(w1) \
147  { 28, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
148 
149 /* Link Object pointer to the current dynobj */
150 /* Supported Objs: groups, bones, faces, cameras, views, labels, animators */
151 #define LinkWithPtr(w1) \
152  { 29, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
153 
154 /* Set Object ID as the current dynobj */
155 /* Supported Objs: all */
156 #define UseObj(w1) \
157  { 30, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
158 
159 /* Set the current Net object's control type field */
160 /* Supported Objs: nets */
161 #define SetControlType(w2) \
162  { 31, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
163 
164 /* Set the weight of the current Joint object with ID and VALUE */
165 /* Supported Objs: joints */
166 #define SetSkinWeight(w2, x) \
167  { 32, {0}, {(void *)(w2)}, {(x), 0.0, 0.0} }
168 
169 /* Set the ambient color of the current Material object */
170 /* Supported Objs: materials */
171 #define SetAmbient(x, y, z) \
172  { 33, {0}, {0}, {(x), (y), (z)} }
173 
174 /* Set the diffuse color of the current Material or Light object */
175 /* Supported Objs: materials, lights */
176 #define SetDiffuse(x, y, z) \
177  { 34, {0}, {0}, {(x), (y), (z)} }
178 
179 /* Set the numerical Object ID field (not dynobj id) */
180 /* Supported Objs: joints, vertices, materials, lights */
181 #define SetId(w2) \
182  { 35, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
183 
184 /* Set the material id of the current Face */
185 /* Supported Objs: faces */
186 #define SetMaterial(w1, w2) \
187  { 36, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
188 
189 /* Map Materials from Group ID to the current Group obj */
190 /* Supported Objs: groups */
191 #define MapMaterials(w1) \
192  { 37, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
193 
194 /* Map vertices from Group ID to the current Group obj, and correct any vertex indices to pointers */
195 /* Supported Objs: groups */
196 #define MapVertices(w1) \
197  { 38, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
198 
199 /* Stub command */
200 /* Supported Objs: joints */
201 #define Attach(w1) \
202  { 39, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
203 
204 /* Attach the current dynobj with modifications made by FLAG to Object ID */
205 /* Supported Objs: joints, particles, nets, animators */
206 #define AttachTo(w2, w1) \
207  { 40, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
208 
209 /* Set the offset of the attached object for the current dynobj */
210 /* Supported Objs: joints, particles, nets */
211 #define SetAttachOffset(x, y, z) \
212  { 41, {0}, {0}, {(x), (y), (z)} }
213 
214 /* Copy the C-string pointed to by PTR to the dynobj id buf */
215 #define CopyStrToIdBuf(w1) \
216  { 43, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
217 
218 /* Set f32 paramter PARAM to VALUE. TODO: Ennumerate parameters */
219 /* Supported Objs: shapes, vertices, gadgets */
220 #define SetParamF(w2, x) \
221  { 44, {0}, {(void *)(w2)}, {(x), 0.0, 0.0} }
222 
223 /* Set pointer paramter PARAM to PTR */
224 /* Supported Objs: faces, views, labels */
225 #define SetParamPtr(w2, w1) \
226  { 45, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
227 
228 /* Create a Net and a subgroup with ID. ARG1 is not used */
229 #define MakeNetWithSubGroup(w2, w1) \
230  { 46, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
231 
232 /* Make Joint ID and attach the Net created with "MakeNetWithSubGroup". ARG1 is not used */
233 #define AttachNetToJoint(w2, w1) \
234  { 47, {(void *)(w1)}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
235 
236 /* Ends a net sub-Group ID that was created with "MakeNetWithSubGroup" */
237 #define EndNetSubGroup(w1) \
238  { 48, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
239 
240 /* Add a Vertex dynobj */
241 #define MakeVertex(x, y, z) \
242  { 49, {0}, {0}, {(x), (y), (z)} }
243 
244 /* Add a ValPtr dynobj */
245 #define MakeValPtr(id, flags, type, offset) \
246  { 50, {(void *)(id)}, {(void *)(type)}, {(offset), (flags), 0.0} }
247 
248 /* Add the texture pointed to by PTR to the current dynobj */
249 /* Supported Objs: materials */
250 #define UseTexture(w2) \
251  { 52, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }
252 
253 /* Set the S and T values of the current dynobj */
254 /* Supported Objs: vertices */
255 #define SetTextureST(x, y) \
256  { 53, {0}, {0}, {(x), (y), 0.0} }
257 
258 /* Make a new Net from Shape ID */
259 #define MakeNetFromShapeId(w1) \
260  { 54, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
261 
262 /* Make a new Net from Shape double pointer PTR */
263 #define MakeNetFromShapeDblPtr(w1) \
264  { 55, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }
265 
266 #endif /* _DYN_LIST_MACROS_H_ */