/////////////////////////////////////////////////////////////////// G_ParseAnimFileSet This function is responsible for building the animation file and the animation event file. ///////////////////////////////////////////////////////////////////
| 1038 | // |
| 1039 | //////////////////////////////////////////////////////////////////////// |
| 1040 | int G_ParseAnimFileSet(const char *skeletonName, const char *modelName=0) |
| 1041 | { |
| 1042 | int fileIndex=0; |
| 1043 | |
| 1044 | |
| 1045 | // Try To Find An Existing Skeleton File For This Animation Set |
| 1046 | //-------------------------------------------------------------- |
| 1047 | for (fileIndex=0; fileIndex<level.numKnownAnimFileSets; fileIndex++) |
| 1048 | { |
| 1049 | if (Q_stricmp(level.knownAnimFileSets[fileIndex].filename, skeletonName)==0) |
| 1050 | { |
| 1051 | break; |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | // Ok, We Don't Already Have One, So Time To Create A New One And Initialize It |
| 1056 | //------------------------------------------------------------------------------ |
| 1057 | if (fileIndex>=level.numKnownAnimFileSets) |
| 1058 | { |
| 1059 | if (level.numKnownAnimFileSets==MAX_ANIM_FILES) |
| 1060 | { |
| 1061 | G_Error( "G_ParseAnimFileSet: MAX_ANIM_FILES" ); |
| 1062 | return -1; |
| 1063 | } |
| 1064 | |
| 1065 | // Allocate A new File Set, And Get Some Shortcut Pointers |
| 1066 | //--------------------------------------------------------- |
| 1067 | fileIndex = level.numKnownAnimFileSets; |
| 1068 | level.numKnownAnimFileSets++; |
| 1069 | strcpy(level.knownAnimFileSets[fileIndex].filename, skeletonName); |
| 1070 | |
| 1071 | level.knownAnimFileSets[fileIndex].torsoAnimEventCount = 0; |
| 1072 | level.knownAnimFileSets[fileIndex].legsAnimEventCount = 0; |
| 1073 | |
| 1074 | animation_t* animations = level.knownAnimFileSets[fileIndex].animations; |
| 1075 | animevent_t* legsAnimEvents = level.knownAnimFileSets[fileIndex].legsAnimEvents; |
| 1076 | animevent_t* torsoAnimEvents = level.knownAnimFileSets[fileIndex].torsoAnimEvents; |
| 1077 | |
| 1078 | int i, j; |
| 1079 | |
| 1080 | // Initialize The Frames Information |
| 1081 | //----------------------------------- |
| 1082 | for(i=0; i<MAX_ANIMATIONS; i++) |
| 1083 | { |
| 1084 | animations[i].firstFrame = 0; |
| 1085 | animations[i].numFrames = 0; |
| 1086 | animations[i].loopFrames = -1; |
| 1087 | animations[i].frameLerp = 100; |
| 1088 | // animations[i].initialLerp = 100; |
| 1089 | animations[i].glaIndex = 0; |
| 1090 | } |
| 1091 | |
| 1092 | // Initialize Animation Event Array |
| 1093 | //---------------------------------- |
| 1094 | for(i=0; i<MAX_ANIM_EVENTS; i++) |
| 1095 | { |
| 1096 | torsoAnimEvents[i].eventType = AEV_NONE; //Type of event |
| 1097 | legsAnimEvents[i].eventType = AEV_NONE; |
no test coverage detected