STDAPI DllUnregisterServer() { // Unregister the CLSID UnregisterObject(CLSID_Hack); return S_OK; }
STDAPI DllUnregisterServer() { // Unregister the CLSID UnregisterObject(CLSID_CustomEVRPresenter); return S_OK; }
virtual void DeleteObject(const ezUuid& guid) override { auto object = GetObjectByGUID(guid); object.m_pType->GetAllocator()->Deallocate(object.m_pObject); UnregisterObject(guid); }
STDAPI DllUnregisterServer() { // Unregister the MFT. MFTUnregister(CLSID_GrayscaleMFT); // Unregister the CLSID. UnregisterObject(CLSID_GrayscaleMFT); return S_OK; }
/* Called by CObject::SetID() when a CObject's ID is changed. Shouldn't be called from any other place. */ void CBaseManager::ReregisterObject(CObject& obj, uint32 newId) { /* In the CTracker singleton, we are concerned with keeping: -Aliases. They don't use object ID, just pointers -Event listeners: don't use ID, so no worries -Waiting script entries: scan through and change stored ID */ m_new_id_of_object_being_momentarily_removed = newId; m_momentary_removal = true; UnregisterObject(obj); obj.m_id = newId; RegisterObject(obj); m_momentary_removal = false; }
int CDOSObjectGroup::ProcessObjectRegister(int ProcessLimit) { FUNCTION_BEGIN; CAutoLock Lock(m_EasyCriticalSection); int ProcessCount=0; DOS_OBJECT_REGISTER_INFO ObjectRegisterInfo; while(m_ObjectRegisterQueue.PopFront(ObjectRegisterInfo)) { UINT ID; DOS_OBJECT_INFO * pObjectInfo=NULL; ID=m_ObjectPool.NewObject(&pObjectInfo); if(pObjectInfo) { pObjectInfo->ObjectID=ObjectRegisterInfo.ObjectID; pObjectInfo->ObjectID.GroupIndex=m_Index; pObjectInfo->ObjectID.ObjectIndex=ID; OnObjectRegister(pObjectInfo->ObjectID); pObjectInfo->Weight=ObjectRegisterInfo.Weight; pObjectInfo->Param=ObjectRegisterInfo.Param; pObjectInfo->pObject=ObjectRegisterInfo.pObject; pObjectInfo->pObject->SetObjectID(pObjectInfo->ObjectID); pObjectInfo->pObject->SetGroup(this); if(!pObjectInfo->pObject->Init(ObjectRegisterInfo)) { UnregisterObject(pObjectInfo->ObjectID); } } else { PrintDOSLog(0,_T("CDOSObjectGroup::ProcessObjectRegister:对象池已耗尽%u/%u"),m_ObjectPool.GetObjectCount(),m_ObjectPool.GetBufferSize()); m_Weight-=ObjectRegisterInfo.Weight; ObjectRegisterInfo.pObject->Destory(); SAFE_RELEASE(ObjectRegisterInfo.pObject); } ProcessLimit--; ProcessCount++; if(ProcessLimit<=0) break; } return ProcessCount; FUNCTION_END; return 0; }
void cBonusShot::Step (uint32_t a_ElapsedMiliSec) { // Calculate angle to destination double l_AngleToDest = atan2(m_Destination.y - GetPosition().y, m_Destination.x - GetPosition().x); if (m_AngleInRadians < l_AngleToDest + g_kPI / 40 || m_AngleInRadians > l_AngleToDest - g_kPI / 40) { // We need to rotate our angle towards destination. Figure out direction. bool l_IsClockwise = false; if (l_AngleToDest < -g_kPI / 2.0) { l_IsClockwise = true; } double l_AngleDiff = l_AngleToDest - m_AngleInRadians; l_AngleDiff = std::fmod(l_AngleDiff, 2 * g_kPI); //~ if (l_AngleDiff > 0) //~ { //~ l_IsClockwise = false; //~ } //~ //~ if (l_AngleDiff > g_kPI) //~ { //~ l_IsClockwise = !l_IsClockwise; //~ } // Now rotate if (m_Speed < g_kMaxSpeed) { m_Speed += g_kAcceleration * a_ElapsedMiliSec / 1000; } //~ else //~ { //~ std::cout << "MAXXXXXXXXXXXX" << std::endl; //~ } double l_DistanceToRotate = m_Speed / 1000 * 4 * g_kPI * a_ElapsedMiliSec / 1000.0; if (l_DistanceToRotate > fabs(l_AngleDiff)) { m_AngleInRadians = l_AngleToDest; } else if (l_IsClockwise) { m_AngleInRadians -= l_DistanceToRotate; if (m_AngleInRadians < -g_kPI) { m_AngleInRadians += 2 * g_kPI; } } else { m_AngleInRadians += l_DistanceToRotate; if (m_AngleInRadians > g_kPI) { m_AngleInRadians -= 2 * g_kPI; } } } SetVelocityX(cos(m_AngleInRadians) * m_Speed, kNormal); SetVelocityY(sin(m_AngleInRadians) * m_Speed, kNormal); // If the destination is between our position and original position then we // made it. sf::Vector3<double> l_Distance1 = m_Destination - m_OriginalPosition; sf::Vector3<double> l_Distance2 = GetPosition() - m_OriginalPosition; if (fabs(l_Distance2.x) > fabs(l_Distance1.x)) { UnregisterObject(true); } }
void cCountdownStart::Step (uint32_t a_ElapsedMiliSec) { m_TimeAlive += a_ElapsedMiliSec; if (m_TimeAlive > 1300 && m_State == kThreeState) { LoadAnimations("Media/Countdown.ani"); PlayAnimationLoop("Three"); PlaySound("Media/Sounds/BlockMove.wav"); m_State = kTwoState; } else if (m_TimeAlive > 1900 && m_State == kTwoState) { PlayAnimationLoop("Two"); PlaySound("Media/Sounds/BlockMove.wav"); m_State = kOneState; } else if (m_TimeAlive > 2500 && m_State == kOneState) { PlayAnimationLoop("One"); PlaySound("Media/Sounds/BlockMove.wav"); m_State = kGoState; } else if (m_TimeAlive > 3100 && m_State == kGoState) { PlayAnimationLoop("Go"); PlaySound("Media/Sounds/BlockMove.wav"); GetResources()->GetBackGroundMusic()->play(); m_State = kWaitState; } else if (m_TimeAlive > 3700) { if (GetResources()->GetGameConfigData()->GetProperty("GameType") == "Challenge") { // Anti-cheating measure. If this is a challenge game then mark the game // in progress. If the player quits out then we can use this to increase // the retry count std::string l_GameStarted = (*(GetResources()->GetGameConfigData()))["Challenge"]["GameStarted"]; if (l_GameStarted == "1") { std::string l_RetryString = (*(GetResources()->GetGameConfigData()))["Challenge"]["Retries"]; if (l_RetryString.empty()) { l_RetryString = "0"; } uint32_t l_RetryCount = std::stoi(l_RetryString); ++l_RetryCount; (*(GetResources()->GetGameConfigData()))["Challenge"]["Retries"] = std::to_string(l_RetryCount); } (*(GetResources()->GetGameConfigData()))["Challenge"]["GameStarted"] = "1"; // Save progress for testing // (*(GetResources()->GetGameConfigData()))["Challenge"].ExportToFile("Config/SaveGame.SG"); } // Tell the players they can begin. sMessage l_Message; l_Message.m_From = GetUniqueId(); l_Message.m_Category = "StartGame"; l_Message.m_Key = "StartGame"; l_Message.m_Value = "StartGame"; GetResources()->GetMessageDispatcher()->PostMessage(l_Message); UnregisterObject(true); } }
PUBLIC( void, UnloadPlugin )( void ) // this routine is called when /unload is invoked { UnregisterObject( "odbc" ); //UnregisterRoutine( "odbc" ); }