mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Mass rename CxPrivate to CmptPrivate.
As part of the SM45->52 migration, a ScriptInterface becomes a wrapper around a JSCompartment, not a JSContext, thus we ought to store private data for the compartment and not the context. This is a mass rename of CxPrivate to CmptPrivate to match that before the actual changes. Part of the SM52 migration, stage: SM45 compatible Patch by: Itms Tested By: Freagarach Refs #4893 Differential Revision: https://code.wildfiregames.com/D3089 This was SVN commit r24177.
This commit is contained in:
@@ -149,9 +149,9 @@ bool CComponentManager::LoadScript(const VfsPath& filename, bool hotload)
|
||||
return ok;
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterComponentType_Common(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor, bool reRegister, bool systemComponent)
|
||||
void CComponentManager::Script_RegisterComponentType_Common(ScriptInterface::CmptPrivate* pCmptPrivate, int iid, const std::string& cname, JS::HandleValue ctor, bool reRegister, bool systemComponent)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
ScriptInterface::Request rq(componentManager->m_ScriptInterface);
|
||||
|
||||
// Find the C++ component that wraps the interface
|
||||
@@ -315,28 +315,28 @@ void CComponentManager::Script_RegisterComponentType_Common(ScriptInterface::CxP
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
void CComponentManager::Script_RegisterComponentType(ScriptInterface::CmptPrivate* pCmptPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
componentManager->Script_RegisterComponentType_Common(pCxPrivate, iid, cname, ctor, false, false);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
componentManager->Script_RegisterComponentType_Common(pCmptPrivate, iid, cname, ctor, false, false);
|
||||
componentManager->m_ScriptInterface.SetGlobal(cname.c_str(), ctor, componentManager->m_CurrentlyHotloading);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterSystemComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
void CComponentManager::Script_RegisterSystemComponentType(ScriptInterface::CmptPrivate* pCmptPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
componentManager->Script_RegisterComponentType_Common(pCxPrivate, iid, cname, ctor, false, true);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
componentManager->Script_RegisterComponentType_Common(pCmptPrivate, iid, cname, ctor, false, true);
|
||||
componentManager->m_ScriptInterface.SetGlobal(cname.c_str(), ctor, componentManager->m_CurrentlyHotloading);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_ReRegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
void CComponentManager::Script_ReRegisterComponentType(ScriptInterface::CmptPrivate* pCmptPrivate, int iid, const std::string& cname, JS::HandleValue ctor)
|
||||
{
|
||||
Script_RegisterComponentType_Common(pCxPrivate, iid, cname, ctor, true, false);
|
||||
Script_RegisterComponentType_Common(pCmptPrivate, iid, cname, ctor, true, false);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterInterface(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name)
|
||||
void CComponentManager::Script_RegisterInterface(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& name)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::map<std::string, InterfaceId>::iterator it = componentManager->m_InterfaceIdsByName.find(name);
|
||||
if (it != componentManager->m_InterfaceIdsByName.end())
|
||||
@@ -355,9 +355,9 @@ void CComponentManager::Script_RegisterInterface(ScriptInterface::CxPrivate* pCx
|
||||
componentManager->m_ScriptInterface.SetGlobal(("IID_" + name).c_str(), (int)id);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterMessageType(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name)
|
||||
void CComponentManager::Script_RegisterMessageType(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& name)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::map<std::string, MessageTypeId>::iterator it = componentManager->m_MessageTypeIdsByName.find(name);
|
||||
if (it != componentManager->m_MessageTypeIdsByName.end())
|
||||
@@ -375,22 +375,22 @@ void CComponentManager::Script_RegisterMessageType(ScriptInterface::CxPrivate* p
|
||||
componentManager->m_ScriptInterface.SetGlobal(("MT_" + name).c_str(), (int)id);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_RegisterGlobal(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name, JS::HandleValue value)
|
||||
void CComponentManager::Script_RegisterGlobal(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& name, JS::HandleValue value)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
componentManager->m_ScriptInterface.SetGlobal(name.c_str(), value, componentManager->m_CurrentlyHotloading);
|
||||
}
|
||||
|
||||
IComponent* CComponentManager::Script_QueryInterface(ScriptInterface::CxPrivate* pCxPrivate, int ent, int iid)
|
||||
IComponent* CComponentManager::Script_QueryInterface(ScriptInterface::CmptPrivate* pCmptPrivate, int ent, int iid)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
IComponent* component = componentManager->QueryInterface((entity_id_t)ent, iid);
|
||||
return component;
|
||||
}
|
||||
|
||||
std::vector<int> CComponentManager::Script_GetEntitiesWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid)
|
||||
std::vector<int> CComponentManager::Script_GetEntitiesWithInterface(ScriptInterface::CmptPrivate* pCmptPrivate, int iid)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::vector<int> ret;
|
||||
const InterfaceListUnordered& ents = componentManager->GetEntitiesWithInterfaceUnordered(iid);
|
||||
@@ -401,9 +401,9 @@ std::vector<int> CComponentManager::Script_GetEntitiesWithInterface(ScriptInterf
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<IComponent*> CComponentManager::Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid)
|
||||
std::vector<IComponent*> CComponentManager::Script_GetComponentsWithInterface(ScriptInterface::CmptPrivate* pCmptPrivate, int iid)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::vector<IComponent*> ret;
|
||||
InterfaceList ents = componentManager->GetEntitiesWithInterface(iid);
|
||||
@@ -427,9 +427,9 @@ CMessage* CComponentManager::ConstructMessage(int mtid, JS::HandleValue data)
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentManager::Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data)
|
||||
void CComponentManager::Script_PostMessage(ScriptInterface::CmptPrivate* pCmptPrivate, int ent, int mtid, JS::HandleValue data)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
CMessage* msg = componentManager->ConstructMessage(mtid, data);
|
||||
if (!msg)
|
||||
@@ -440,9 +440,9 @@ void CComponentManager::Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivat
|
||||
delete msg;
|
||||
}
|
||||
|
||||
void CComponentManager::Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data)
|
||||
void CComponentManager::Script_BroadcastMessage(ScriptInterface::CmptPrivate* pCmptPrivate, int mtid, JS::HandleValue data)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
CMessage* msg = componentManager->ConstructMessage(mtid, data);
|
||||
if (!msg)
|
||||
@@ -453,9 +453,9 @@ void CComponentManager::Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxP
|
||||
delete msg;
|
||||
}
|
||||
|
||||
int CComponentManager::Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName)
|
||||
int CComponentManager::Script_AddEntity(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& templateName)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::wstring name(templateName.begin(), templateName.end());
|
||||
// TODO: should validate the string to make sure it doesn't contain scary characters
|
||||
@@ -465,9 +465,9 @@ int CComponentManager::Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate,
|
||||
return (int)ent;
|
||||
}
|
||||
|
||||
int CComponentManager::Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName)
|
||||
int CComponentManager::Script_AddLocalEntity(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& templateName)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
std::wstring name(templateName.begin(), templateName.end());
|
||||
// TODO: should validate the string to make sure it doesn't contain scary characters
|
||||
@@ -477,16 +477,16 @@ int CComponentManager::Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPriv
|
||||
return (int)ent;
|
||||
}
|
||||
|
||||
void CComponentManager::Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent)
|
||||
void CComponentManager::Script_DestroyEntity(ScriptInterface::CmptPrivate* pCmptPrivate, int ent)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
|
||||
componentManager->DestroyComponentsSoon(ent);
|
||||
}
|
||||
|
||||
void CComponentManager::Script_FlushDestroyedEntities(ScriptInterface::CxPrivate *pCxPrivate)
|
||||
void CComponentManager::Script_FlushDestroyedEntities(ScriptInterface::CmptPrivate *pCmptPrivate)
|
||||
{
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
|
||||
CComponentManager* componentManager = static_cast<CComponentManager*> (pCmptPrivate->pCBData);
|
||||
componentManager->FlushDestroyedComponents();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user