Path: blob/master/src/goddard/dynlists/dynlist_macros.h
7861 views
#ifndef GD_DYNLIST_MACROS_H1#define GD_DYNLIST_MACROS_H23/* DynListCmd Macros */45/**6* Must be the first command in a dynlist.7*/8#define BeginList() \9{ 53716, {0}, {0}, {0.0, 0.0, 0.0} }1011/**12* Must be the last command in a dynlist.13*/14#define EndList() \15{ 58, {0}, {0}, {0.0, 0.0, 0.0} }1617/**18* If `enable` is TRUE, then subsequent object names are treated as integers19* rather than strings.20*/21#define UseIntegerNames(enable) \22{ 0, {0}, {(void *)(enable)}, {0.0, 0.0, 0.0} }2324/**25* Set the initial position of the current object26* Supported Objs: joints, particles, nets, vertices, cameras27*/28#define SetInitialPosition(x, y, z) \29{ 1, {0}, {0}, {(x), (y), (z)} }3031/**32* Set the relative position of the current object33* Supported Objs: joints, particles, vertices, cameras, labels34*/35#define SetRelativePosition(x, y, z) \36{ 2, {0}, {0}, {(x), (y), (z)} }3738/**39* Set the world position of the current object40* Supported Objs: joints, nets, vertices, cameras, gadgets, views41*/42#define SetWorldPosition(x, y, z) \43{ 3, {0}, {0}, {(x), (y), (z)} }4445/**46* Set the normal of the current object47* Supported Objs: vertices48*/49#define SetNormal(x, y, z) \50{ 4, {0}, {0}, {(x), (y), (z)} }5152/**53* Set the scale of the current object54* Supported Objs: joints, particles, nets, gadgets, views, lights55*/56#define SetScale(x, y, z) \57{ 5, {0}, {0}, {(x), (y), (z)} }5859/**60* Set the rotation of the current object61* Supported Objs: joints, nets62*/63#define SetRotation(x, y, z) \64{ 6, {0}, {0}, {(x), (y), (z)} }6566/**67* Set the specified bits in the object's `drawFlags` field68* Supported Objs: all69*/70#define SetDrawFlag(flags) \71{ 7, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} }7273/**74* Set the specified bits in the object specific flag75* Supported Objs: bones, joints, particles, shapes, nets, cameras, views, lights76*/77#define SetFlag(flags) \78{ 8, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} }7980/**81* Clear the specified bits in the object specific flag82* Supported Objs: bones, joints, particles, nets, cameras83*/84#define ClearFlag(flags) \85{ 9, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} }8687/**88* Set the friction vector of a Joint89* Supported Objs: joints90*/91#define SetFriction(x, y, z) \92{ 10, {0}, {0}, {(x), (y), (z)} }9394/**95* Set the spring value of a Bone96* Supported Objs: bones97*/98#define SetSpring(spring) \99{ 11, {0}, {0}, {(spring), 0.0, 0.0} }100101/**102* Jump to pointed dynlist. Once that list has finished processing, flow returns103* to the current list.104*/105#define CallList(list) \106{ 12, {(void *)(list)}, {0}, {0.0, 0.0, 0.0} }107108/**109* Sets the object's color to one of the predefined colors (see draw_objects.h110* for the list of colors.111* Supported Objs: joints, particles, nets, faces, gadgets112*/113#define SetColourNum(colourNum) \114{ 13, {0}, {(void *)(colourNum)}, {0.0, 0.0, 0.0} }115116/**117* Make an object of the specified type and name, and set it as the current118* object.119*/120#define MakeDynObj(type, name) \121{ 15, {(void *)(name)}, {(void *)(type)}, {0.0, 0.0, 0.0} }122123/**124* Make a group that will contain all subsequently created objects once the125* EndGroup command is called.126*/127#define StartGroup(grpName) \128{ 16, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} }129130/**131* End a group. All objects created between StartGroup and EndGroup are added to132* the group.133*/134#define EndGroup(grpName) \135{ 17, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} }136137/**138* Add the current object to the specified group.139* Supported Objs: all140*/141#define AddToGroup(grpName) \142{ 18, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} }143144/**145* Set an object specific type flag.146* Supported Objs: groups, joints, particles, nets, materials, gadgets147*/148#define SetType(type) \149{ 19, {0}, {(void *)(type)}, {0.0, 0.0, 0.0} }150151/**152* Set the current shape's material group to the specified group.153* Supported Objs: shapes154*/155#define SetMaterialGroup(mtlGrpName) \156{ 20, {(void *)(mtlGrpName)}, {0}, {0.0, 0.0, 0.0} }157158/**159* Assign the specified group to the current object. The purpose of the group160* depends on the current object's type. For shapes, it sets the vertex data.161* For animators, it sets the animation data. For nets, it sets ???. For162* gadgets, it sets ???.163* Supported Objs: shapes, nets, gadgets, animators164*/165#define SetNodeGroup(grpName) \166{ 21, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} }167168/**169* Set the skin group of the current Net object with the vertices from the170* specified shape.171* Supported Objs: nets172*/173#define SetSkinShape(shapeName) \174{ 22, {(void *)(shapeName)}, {0}, {0.0, 0.0, 0.0} }175176/**177* Set the plane (face) group of the current object.178* Supported Objs: shapes, nets179*/180#define SetPlaneGroup(planeGrpName) \181{ 23, {(void *)(planeGrpName)}, {0}, {0.0, 0.0, 0.0} }182183/**184* Set the current object's shape, where `shapePtr` is a pointer to an185* `ObjShape`.186* Supported Objs: bones, joints, particles, nets, gadgets, lights187*/188#define SetShapePtrPtr(shapePtr) \189{ 24, {(void *)(shapePtr)}, {0}, {0.0, 0.0, 0.0} }190191/**192* Set the current object's shape, where `shapeName` is the name of a shape193* object.194* Supported Objs: bones, joints, particles, nets, gadgets195*/196#define SetShapePtr(shapeName) \197{ 25, {(void *)(shapeName)}, {0}, {0.0, 0.0, 0.0} }198199/**200* Set offset of the connected shape201* Supported Objs: joints202*/203#define SetShapeOffset(x, y, z) \204{ 26, {0}, {0}, {(x), (y), (z)} }205206/**207* Set the center of gravity of the current Net object208* Supported Objs: nets209*/210#define SetCenterOfGravity(x, y, z) \211{ 27, {0}, {0}, {(x), (y), (z)} }212213// TODO:214215/* Link Object ID to the current dynobj */216/* Supported Objs: groups, bones, faces, cameras, views, labels, animators */217#define LinkWith(w1) \218{ 28, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }219220/* Link Object pointer to the current dynobj */221/* Supported Objs: groups, bones, faces, cameras, views, labels, animators */222#define LinkWithPtr(w1) \223{ 29, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }224225/**226* Set the specified object as the current object.227* Supported Objs: all228*/229#define UseObj(name) \230{ 30, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }231232/**233* Set the current Net object's control type field. Control type is never used234* for anything, so this command effectively does nothing.235* Supported Objs: nets236*/237#define SetControlType(w2) \238{ 31, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} }239240/**241* Set the weight percentage of the specified vertex controlled by the current242* Joint object.243* Supported Objs: joints244*/245#define SetSkinWeight(vtxNum, weight) \246{ 32, {0}, {(void *)(vtxNum)}, {(weight), 0.0, 0.0} }247248/**249* Set the ambient color of the current Material object.250* Supported Objs: materials251*/252#define SetAmbient(r, g, b) \253{ 33, {0}, {0}, {(r), (g), (b)} }254255/**256* Set the diffuse color of the current Material or Light object.257* Supported Objs: materials, lights258*/259#define SetDiffuse(r, g, b) \260{ 34, {0}, {0}, {(r), (g), (b)} }261262/**263* Set the object specific ID field.264* Supported Objs: joints, vertices, materials, lights265*/266#define SetId(id) \267{ 35, {0}, {(void *)(id)}, {0.0, 0.0, 0.0} }268269/**270* Set the material id of the current Face271* Supported Objs: faces272*/273#define SetMaterial(id) \274{ 36, {0}, {(void *)(id)}, {0.0, 0.0, 0.0} }275276/**277* For all faces in the current Group, resolve their material IDs to actual278* `ObjMaterial`s.279* Supported Objs: groups280*/281#define MapMaterials(name) \282{ 37, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }283284/**285* For all faces in the current Group, resolve their vertex indices to pointers286* to actual `ObjVertex`es. Calculate normals for all vertices in the the group287* specified by `name`288* Supported Objs: groups289*/290#define MapVertices(name) \291{ 38, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }292293/**294* Stub command (does nothing).295* Supported Objs: joints296*/297#define Attach(name) \298{ 39, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }299300/**301* Attach the current object to the specified object, using the specified flags.302* Supported Objs: joints, particles, nets, animators303*/304#define AttachTo(flags, name) \305{ 40, {(void *)(name)}, {(void *)(flags)}, {0.0, 0.0, 0.0} }306307/**308* Set the point at which the current object is attached to its parent object309* Supported Objs: joints, particles, nets310*/311#define SetAttachOffset(x, y, z) \312{ 41, {0}, {0}, {(x), (y), (z)} }313314/**315* Set a "suffix" to use with dynobj names. All commands that take a name as a316* parameter will have this suffix appended to the name.317*/318#define SetNameSuffix(suffix) \319{ 43, {(void *)(suffix)}, {0}, {0.0, 0.0, 0.0} }320321/**322* Set the float paramter `param` to `value`.323* For Shapes, the following parameters are supported:324* PARM_F_ALPHA - the alpha (opacity) of the shape325* For Gadgets, the following parameters are supported:326* PARM_F_RANGE_MIN - the minimum value of the gadget327* PARM_F_RANGE_MAX - the maximum value of the gadget328* PARM_F_VARVAL - the current value of the gadget329* For Vertices, the following parameters are supported:330* PARM_F_ALPHA - the alpha (opacity) of the vertex331* Supported Objs: shapes, vertices, gadgets332*/333#define SetParamF(param, value) \334{ 44, {0}, {(void *)(param)}, {(value), 0.0, 0.0} }335336/**337* Set pointer paramter `param` to `value`338* For Labels, the following parameters are supported:339* PARM_PTR_CHAR - the format string for the label text340* For Views, the following parameters are supported:341* PARM_PTR_CHAR - the name of the view342* For Faces, the following parameters are supported:343* PARM_PTR_OBJ_VTX - (not actually a pointer) index of a vertex created with `MakeVertex`.344* Supported Objs: faces, views, labels */345#define SetParamPtr(param, value) \346{ 45, {(void *)(value)}, {(void *)(param)}, {0.0, 0.0, 0.0} }347348/**349* Create a Net with the specified name, and add a group to it.350*/351#define MakeNetWithSubGroup(name) \352{ 46, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }353354/**355* Make a Joint and attach it to the Net created with "MakeNetWithSubGroup".356*/357#define MakeAttachedJoint(name) \358{ 47, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }359360/**361* End a Net that was created with "MakeNetWithSubGroup"362*/363#define EndNetWithSubGroup(name) \364{ 48, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} }365366/**367* Add a Vertex dynobj368*/369#define MakeVertex(x, y, z) \370{ 49, {0}, {0}, {(x), (y), (z)} }371372/**373* Add a ValPtr dynobj374*/375#define MakeValPtr(id, flags, type, offset) \376{ 50, {(void *)(id)}, {(void *)(type)}, {(offset), (flags), 0.0} }377378/**379* Set the texture of the current Material dynobj. Note that textures are not380* actually supported.381* Supported Objs: materials382*/383#define UseTexture(texture) \384{ 52, {0}, {(void *)(texture)}, {0.0, 0.0, 0.0} }385386/**387* Stub command (does nothing).388* Supported Objs: vertices389*/390#define SetTextureST(s, t) \391{ 53, {0}, {0}, {(s), (t), 0.0} }392393/* Make a new Net from Shape ID */394#define MakeNetFromShape(shape) \395{ 54, {(void *)(shape)}, {0}, {0.0, 0.0, 0.0} }396397/* Make a new Net from Shape double pointer PTR */398#define MakeNetFromShapePtrPtr(w1) \399{ 55, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} }400401#endif // GD_DYNLIST_MACROS_H402403404