| 484 | |
| 485 | |
| 486 | int b3PluginManager::registerStaticLinkedPlugin(const char* pluginPath, b3PluginFunctions& functions, bool initPlugin) |
| 487 | { |
| 488 | b3Plugin orgPlugin; |
| 489 | |
| 490 | int pluginUniqueId = m_data->m_plugins.allocHandle(); |
| 491 | b3PluginHandle* pluginHandle = m_data->m_plugins.getHandle(pluginUniqueId); |
| 492 | pluginHandle->m_pluginHandle = 0; |
| 493 | pluginHandle->m_ownsPluginHandle = false; |
| 494 | pluginHandle->m_pluginUniqueId = pluginUniqueId; |
| 495 | pluginHandle->m_executeCommandFunc = functions.m_executeCommandFunc; |
| 496 | pluginHandle->m_exitFunc = functions.m_exitFunc; |
| 497 | pluginHandle->m_initFunc = functions.m_initFunc; |
| 498 | pluginHandle->m_preTickFunc = functions.m_preTickFunc; |
| 499 | pluginHandle->m_postTickFunc = functions.m_postTickFunc; |
| 500 | pluginHandle->m_getRendererFunc = functions.m_getRendererFunc; |
| 501 | pluginHandle->m_getCollisionFunc = functions.m_getCollisionFunc; |
| 502 | pluginHandle->m_processClientCommandsFunc = functions.m_processClientCommandsFunc; |
| 503 | pluginHandle->m_getFileIOFunc = functions.m_fileIoFunc; |
| 504 | pluginHandle->m_pluginHandle = 0; |
| 505 | pluginHandle->m_pluginPath = pluginPath; |
| 506 | pluginHandle->m_pluginPostFix = ""; |
| 507 | pluginHandle->m_userPointer = 0; |
| 508 | pluginHandle->m_returnData = 0; |
| 509 | |
| 510 | if (pluginHandle->m_processNotificationsFunc) |
| 511 | { |
| 512 | m_data->m_numNotificationPlugins++; |
| 513 | } |
| 514 | |
| 515 | m_data->m_pluginMap.insert(pluginHandle->GetMapKey(), pluginUniqueId); |
| 516 | |
| 517 | if (initPlugin) |
| 518 | { |
| 519 | b3PluginContext context = {0}; |
| 520 | context.m_userPointer = 0; |
| 521 | context.m_returnData = 0; |
| 522 | context.m_physClient = (b3PhysicsClientHandle)m_data->m_physicsDirect; |
| 523 | context.m_rpcCommandProcessorInterface = m_data->m_rpcCommandProcessorInterface; |
| 524 | int result = pluginHandle->m_initFunc(&context); |
| 525 | pluginHandle->m_isInitialized = true; |
| 526 | pluginHandle->m_userPointer = context.m_userPointer; |
| 527 | pluginHandle->m_returnData = 0; |
| 528 | } |
| 529 | return pluginUniqueId; |
| 530 | } |
| 531 | |
| 532 | void b3PluginManager::selectPluginRenderer(int pluginUniqueId) |
| 533 | { |
no test coverage detected