| 2827 | } |
| 2828 | |
| 2829 | void ShapeBase::updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData* lastState) |
| 2830 | { |
| 2831 | MountedImage& image = mMountedImageList[imageSlot]; |
| 2832 | ShapeBaseImageData::StateData& stateData = *image.state; |
| 2833 | |
| 2834 | F32 randomPos = Platform::getRandom(); |
| 2835 | for (U32 i=0; i<ShapeBaseImageData::MaxShapes; ++i) |
| 2836 | { |
| 2837 | if (!image.dataBlock->shapeIsValid[i] || (i != imageShapeIndex && !image.doAnimateAllShapes)) |
| 2838 | continue; |
| 2839 | |
| 2840 | if (image.animThread[i] && stateData.sequence[i] != -1) |
| 2841 | { |
| 2842 | S32 seqIndex = stateData.sequence[i]; // Standard index without any prefix |
| 2843 | bool scaleAnim = stateData.scaleAnimation; |
| 2844 | if (i == ShapeBaseImageData::FirstPersonImageShape) |
| 2845 | scaleAnim = stateData.scaleAnimationFP; |
| 2846 | |
| 2847 | // We're going to apply various prefixes to determine the final sequence to use. |
| 2848 | // Here is the order: |
| 2849 | // shapeBasePrefix_scriptPrefix_baseAnimName |
| 2850 | // shapeBasePrefix_baseAnimName |
| 2851 | // scriptPrefix_baseAnimName |
| 2852 | // baseAnimName |
| 2853 | |
| 2854 | // Collect the prefixes |
| 2855 | const char* shapeBasePrefix = getImageAnimPrefix(imageSlot, i); |
| 2856 | bool hasShapeBasePrefix = shapeBasePrefix && shapeBasePrefix[0]; |
| 2857 | const char* scriptPrefix = getImageScriptAnimPrefix(imageSlot).getString(); |
| 2858 | bool hasScriptPrefix = scriptPrefix && scriptPrefix[0]; |
| 2859 | |
| 2860 | // Find the final sequence based on the prefix combinations |
| 2861 | if (hasShapeBasePrefix || hasScriptPrefix) |
| 2862 | { |
| 2863 | bool found = false; |
| 2864 | String baseSeqName(image.shapeInstance[i]->getShape()->getSequenceName(stateData.sequence[i])); |
| 2865 | |
| 2866 | if (!found && hasShapeBasePrefix && hasScriptPrefix) |
| 2867 | { |
| 2868 | String seqName = String(shapeBasePrefix) + String("_") + String(scriptPrefix) + String("_") + baseSeqName; |
| 2869 | S32 index = image.shapeInstance[i]->getShape()->findSequence(seqName); |
| 2870 | if (index != -1) |
| 2871 | { |
| 2872 | seqIndex = index; |
| 2873 | found = true; |
| 2874 | } |
| 2875 | } |
| 2876 | |
| 2877 | if (!found && hasShapeBasePrefix) |
| 2878 | { |
| 2879 | String seqName = String(shapeBasePrefix) + String("_") + baseSeqName; |
| 2880 | S32 index = image.shapeInstance[i]->getShape()->findSequence(seqName); |
| 2881 | if (index != -1) |
| 2882 | { |
| 2883 | seqIndex = index; |
| 2884 | found = true; |
| 2885 | } |
| 2886 | } |
nothing calls this directly
no test coverage detected