| 641 | } |
| 642 | |
| 643 | static void ReHash(ModelWorld* world, ModelComponent* component) |
| 644 | { |
| 645 | // material, textures and render constants |
| 646 | HashState32 state; |
| 647 | bool reverse = false; |
| 648 | dmHashInit32(&state, reverse); |
| 649 | |
| 650 | // The unused slots should be 0 |
| 651 | // Note: In the future, we want the textures so be set on a per-material basis |
| 652 | dmHashUpdateBuffer32(&state, component->m_Textures, DM_ARRAY_SIZE(component->m_Textures)); |
| 653 | |
| 654 | if (component->m_Material) |
| 655 | { |
| 656 | HashMaterial(&state, component->m_Material); |
| 657 | } |
| 658 | |
| 659 | if (component->m_RenderConstants) |
| 660 | { |
| 661 | dmGameSystem::HashRenderConstants(component->m_RenderConstants, &state); |
| 662 | } |
| 663 | |
| 664 | for (int i = 0; i < component->m_RenderItems.Size(); ++i) |
| 665 | { |
| 666 | HashState32 state_clone; |
| 667 | dmHashClone32(&state_clone, &state, false); |
| 668 | HashRenderItem(&state_clone, world, component, component->m_RenderItems[i]); |
| 669 | component->m_RenderItems[i].m_InstanceRenderHash = dmHashFinal32(&state_clone); |
| 670 | } |
| 671 | |
| 672 | component->m_ReHash = 0; |
| 673 | } |
| 674 | |
| 675 | static bool CreateGOBones(ModelWorld* world, ModelComponent* component) |
| 676 | { |
no test coverage detected