| 2419 | } |
| 2420 | |
| 2421 | void TSMesh::assemble( bool skip ) |
| 2422 | { |
| 2423 | tsalloc.checkGuard(); |
| 2424 | |
| 2425 | numFrames = tsalloc.get32(); |
| 2426 | numMatFrames = tsalloc.get32(); |
| 2427 | mParentMesh = tsalloc.get32(); |
| 2428 | tsalloc.get32( (S32*)&mBounds, 6 ); |
| 2429 | tsalloc.get32( (S32*)&mCenter, 3 ); |
| 2430 | mRadius = (F32)tsalloc.get32(); |
| 2431 | |
| 2432 | if (TSShape::smReadVersion >= 27) |
| 2433 | { |
| 2434 | // Offsetted |
| 2435 | mVertOffset = tsalloc.get32(); |
| 2436 | mNumVerts = tsalloc.get32(); |
| 2437 | mVertSize = tsalloc.get32(); |
| 2438 | } |
| 2439 | else |
| 2440 | { |
| 2441 | mVertOffset = 0; |
| 2442 | mNumVerts = 0; |
| 2443 | mVertSize = 0; |
| 2444 | } |
| 2445 | |
| 2446 | S32 numVerts = tsalloc.get32(); |
| 2447 | S32 *ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smVertsList.address(), skip ); |
| 2448 | mVerts.set( (Point3F*)ptr32, numVerts ); |
| 2449 | |
| 2450 | S32 numTVerts = tsalloc.get32(); |
| 2451 | ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVertsList.address(), skip ); |
| 2452 | mTverts.set( (Point2F*)ptr32, numTVerts ); |
| 2453 | |
| 2454 | if ( TSShape::smReadVersion > 25 ) |
| 2455 | { |
| 2456 | numTVerts = tsalloc.get32(); |
| 2457 | ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVerts2List.address(), skip ); |
| 2458 | mTverts2.set( (Point2F*)ptr32, numTVerts ); |
| 2459 | |
| 2460 | S32 numVColors = tsalloc.get32(); |
| 2461 | ptr32 = getSharedData32(mParentMesh, numVColors, (S32**)smColorsList.address(), skip ); |
| 2462 | mColors.set( (ColorI*)ptr32, numVColors ); |
| 2463 | } |
| 2464 | |
| 2465 | S8 *ptr8; |
| 2466 | if ( TSShape::smReadVersion > 21 && TSMesh::smUseEncodedNormals) |
| 2467 | { |
| 2468 | // we have encoded normals and we want to use them... |
| 2469 | if (mParentMesh < 0 ) |
| 2470 | tsalloc.getPointer32( numVerts * 3 ); // adva nce past norms, don't use |
| 2471 | mNorms.set( NULL, 0 ); |
| 2472 | |
| 2473 | ptr8 = getSharedData8(mParentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip ); |
| 2474 | mEncodedNorms.set( ptr8, numVerts ); |
| 2475 | } |
| 2476 | else if ( TSShape::smReadVersion > 21 ) |
| 2477 | { |
| 2478 | // we have encoded normals but we don't want to use them... |
no test coverage detected