| 1930 | //---------------------------------------------------------------------------- |
| 1931 | |
| 1932 | void Player::reSkin() |
| 1933 | { |
| 1934 | if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() ) |
| 1935 | { |
| 1936 | mShapeInstance->resetMaterialList(); |
| 1937 | Vector<String> skins; |
| 1938 | String(mSkinNameHandle.getString()).split( ";", skins ); |
| 1939 | |
| 1940 | for ( S32 i = 0; i < skins.size(); i++ ) |
| 1941 | { |
| 1942 | String oldSkin( mAppliedSkinName.c_str() ); |
| 1943 | String newSkin( skins[i] ); |
| 1944 | |
| 1945 | // Check if the skin handle contains an explicit "old" base string. This |
| 1946 | // allows all models to support skinning, even if they don't follow the |
| 1947 | // "base_xxx" material naming convention. |
| 1948 | S32 split = newSkin.find( '=' ); // "old=new" format skin? |
| 1949 | if ( split != String::NPos ) |
| 1950 | { |
| 1951 | oldSkin = newSkin.substr( 0, split ); |
| 1952 | newSkin = newSkin.erase( 0, split+1 ); |
| 1953 | } |
| 1954 | |
| 1955 | // Apply skin to both 3rd person and 1st person shape instances |
| 1956 | mShapeInstance->reSkin( newSkin, oldSkin ); |
| 1957 | for ( S32 j = 0; j < ShapeBase::MaxMountedImages; j++ ) |
| 1958 | { |
| 1959 | if (mShapeFPInstance[j]) |
| 1960 | mShapeFPInstance[j]->reSkin( newSkin, oldSkin ); |
| 1961 | } |
| 1962 | |
| 1963 | mAppliedSkinName = newSkin; |
| 1964 | } |
| 1965 | } |
| 1966 | } |
| 1967 | |
| 1968 | //---------------------------------------------------------------------------- |
| 1969 |
no test coverage detected