MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / osipf_ObjectCustomAnim

Function osipf_ObjectCustomAnim

Descent3/osiris_predefs.cpp:889–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887extern void AIUpdateAnim(object *obj);
888
889void osipf_ObjectCustomAnim(int handle, float start, float end, float time, char flags, int sound_handle,
890 char next_anim_type) {
891 object *objp = ObjGet(handle);
892
893 if (!objp) {
894 mprintf(0, "AIValue: Illegal Object Passed\n");
895 return;
896 }
897
898 objp->rtype.pobj_info.anim_flags |= AIAF_NOTIFY;
899
900 objp->rtype.pobj_info.custom_anim_info.anim_start_frame = start;
901 objp->rtype.pobj_info.custom_anim_info.anim_end_frame = end;
902 objp->rtype.pobj_info.custom_anim_info.anim_time = time;
903 objp->rtype.pobj_info.custom_anim_info.flags = flags;
904 objp->rtype.pobj_info.custom_anim_info.anim_sound_index = sound_handle;
905 objp->rtype.pobj_info.custom_anim_info.next_anim_type = next_anim_type;
906
907 if (objp->ai_info)
908 objp->ai_info->next_animation_type = AS_CUSTOM;
909 else
910 mprintf(0, "ERROR: Changing animation for non-AI object.\n");
911
912 if (flags & AIAF_IMMEDIATE) {
913 AIUpdateAnim(objp);
914 }
915}
916
917// searches for an object id given it's name
918int osipf_ObjectFindID(const char *name) { return FindObjectIDName(IGNORE_TABLE(name)); }

Callers

nothing calls this directly

Calls 2

ObjGetFunction · 0.85
AIUpdateAnimFunction · 0.85

Tested by

no test coverage detected