| 2863 | } |
| 2864 | |
| 2865 | void ShapeBase::updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData* lastState) |
| 2866 | { |
| 2867 | MountedImage& image = mMountedImageList[imageSlot]; |
| 2868 | ShapeBaseImageData::StateData& stateData = *image.state; |
| 2869 | |
| 2870 | F32 randomPos = Platform::getRandom(); |
| 2871 | for (U32 i=0; i<ShapeBaseImageData::MaxShapes; ++i) |
| 2872 | { |
| 2873 | if (!image.dataBlock->shapeIsValid[i] || (i != imageShapeIndex && !image.doAnimateAllShapes)) |
| 2874 | continue; |
| 2875 | |
| 2876 | if (image.animThread[i] && stateData.sequence[i] != -1) |
| 2877 | { |
| 2878 | S32 seqIndex = stateData.sequence[i]; // Standard index without any prefix |
| 2879 | bool scaleAnim = stateData.scaleAnimation; |
| 2880 | if (i == ShapeBaseImageData::FirstPersonImageShape) |
| 2881 | scaleAnim = stateData.scaleAnimationFP; |
| 2882 | |
| 2883 | // We're going to apply various prefixes to determine the final sequence to use. |
| 2884 | // Here is the order: |
| 2885 | // shapeBasePrefix_scriptPrefix_baseAnimName |
| 2886 | // shapeBasePrefix_baseAnimName |
| 2887 | // scriptPrefix_baseAnimName |
| 2888 | // baseAnimName |
| 2889 | |
| 2890 | // Collect the prefixes |
| 2891 | const char* shapeBasePrefix = getImageAnimPrefix(imageSlot, i); |
| 2892 | bool hasShapeBasePrefix = shapeBasePrefix && shapeBasePrefix[0]; |
| 2893 | const char* scriptPrefix = getImageScriptAnimPrefix(imageSlot).getString(); |
| 2894 | bool hasScriptPrefix = scriptPrefix && scriptPrefix[0]; |
| 2895 | |
| 2896 | // Find the final sequence based on the prefix combinations |
| 2897 | if (hasShapeBasePrefix || hasScriptPrefix) |
| 2898 | { |
| 2899 | bool found = false; |
| 2900 | String baseSeqName(image.shapeInstance[i]->getShape()->getSequenceName(stateData.sequence[i])); |
| 2901 | |
| 2902 | if (!found && hasShapeBasePrefix && hasScriptPrefix) |
| 2903 | { |
| 2904 | String seqName = String(shapeBasePrefix) + String("_") + String(scriptPrefix) + String("_") + baseSeqName; |
| 2905 | S32 index = image.shapeInstance[i]->getShape()->findSequence(seqName); |
| 2906 | if (index != -1) |
| 2907 | { |
| 2908 | seqIndex = index; |
| 2909 | found = true; |
| 2910 | } |
| 2911 | } |
| 2912 | |
| 2913 | if (!found && hasShapeBasePrefix) |
| 2914 | { |
| 2915 | String seqName = String(shapeBasePrefix) + String("_") + baseSeqName; |
| 2916 | S32 index = image.shapeInstance[i]->getShape()->findSequence(seqName); |
| 2917 | if (index != -1) |
| 2918 | { |
| 2919 | seqIndex = index; |
| 2920 | found = true; |
| 2921 | } |
| 2922 | } |
nothing calls this directly
no test coverage detected