| 637 | } |
| 638 | |
| 639 | static void OutputResourceSceneGraph(dmGameObject::SceneNode* node, uint32_t parent, uint32_t* counter, dmWebServer::Request* request) |
| 640 | { |
| 641 | static const dmhash_t s_PropertyId = dmHashString64("id"); |
| 642 | static const dmhash_t s_PropertyResource = dmHashString64("resource"); |
| 643 | static const dmhash_t s_PropertyType = dmHashString64("type"); |
| 644 | |
| 645 | if (node->m_Type == dmGameObject::SCENE_NODE_TYPE_SUBCOMPONENT) |
| 646 | return; |
| 647 | |
| 648 | dmhash_t id = 0; |
| 649 | dmhash_t resource_id = 0; |
| 650 | dmhash_t type = 0; |
| 651 | dmGameObject::SceneNodePropertyIterator pit = TraverseIterateProperties(node); |
| 652 | while(dmGameObject::TraverseIteratePropertiesNext(&pit)) |
| 653 | { |
| 654 | if (pit.m_Property.m_NameHash == s_PropertyId) |
| 655 | id = pit.m_Property.m_Value.m_Hash; |
| 656 | else if (pit.m_Property.m_NameHash == s_PropertyResource) |
| 657 | resource_id = pit.m_Property.m_Value.m_Hash; |
| 658 | else if (pit.m_Property.m_NameHash == s_PropertyType) |
| 659 | type = pit.m_Property.m_Value.m_Hash; |
| 660 | } |
| 661 | |
| 662 | uint32_t index = (*counter)++; |
| 663 | |
| 664 | SendGameObjectData(request, id, resource_id, type, index, parent); |
| 665 | |
| 666 | dmGameObject::SceneNodeIterator it = dmGameObject::TraverseIterateChildren(node); |
| 667 | while(dmGameObject::TraverseIterateNext(&it)) |
| 668 | { |
| 669 | OutputResourceSceneGraph( &it.m_Node, index, counter, request ); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | static void HttpGameObjectRequestCallback(void* context, dmWebServer::Request* request) |
| 674 | { |
no test coverage detected