Exemple #1
0
SDLRenderResource::~SDLRenderResource()
{
    UnLoad();
}
void SceneManager::LoadScene(const int mapnum)
{
	UnLoad();
}
gxConfig::~gxConfig()
{
  // PC-lint 09/08/2005: Function may throw exception in destructor
  UnLoad();
}
int gxConfig::ReLoad(const char *fname)
{
  UnLoad();
  return Load(fname);
}
Exemple #5
0
CDynamicLibrary::~CDynamicLibrary()
{
	UnLoad();
}
Exemple #6
0
CInterfaceManager::~CInterfaceManager()
{
	UnLoad();
}
Exemple #7
0
 //-------------------------------------------------------
 /// Sets array of bones.
 /// Array will be freed in skeleton object!
 ///
 /// \param pBones Bone array.
 //-------------------------------------------------------
 void Skeleton::SetBoneArray(Bone* pBones)
 {
   UnLoad();
   ASSERT(pBones != 0);
   this->pBones = pBones;
 }
Exemple #8
0
void CGUIAudioManager::DeInitialize()
{
  CSingleLock lock(m_cs);
  UnLoad();
}
CTwainSourceManager::~CTwainSourceManager(void)
{
	if(DSMOpen == State) CloseDSM();
	if(DSMLoad == State) UnLoad();
}
Exemple #10
0
 //-------------------------------------------------------
 /// Frees resources.
 //-------------------------------------------------------
 Skeleton::~Skeleton()
 {
   UnLoad();
 }
Exemple #11
0
//
// Attempt to load winsock DLL and obtain entry points to required API.
//
//
HX_RESULT HXWinSockLib::Load()
{
    HXScopeLock lock((IHXMutex*)m_pLoadMutex);

    HXLOGL3(HXLOG_NETW, "HXWinSockLib::Load(): usage count going to %lu", m_userCount + 1);

    if(m_hLib)
    {
        ++m_userCount;
        return HXR_OK;
    }

#if defined(WIN32_PLATFORM_PSPC)   
    const TCHAR* const pszLibName       = "winsock.dll";
    const TCHAR* const pszAltLibName    = 0;
#elif defined(_WIN32)
    const TCHAR* const pszLibName       = "ws2_32.dll"; // 2.X
    const TCHAR* const pszAltLibName    = "winsock32.dll"; // 1.1
#else
    # error fix this
#endif

    HX_RESULT hr = HXR_FAIL;
  
    HXLOGL3(HXLOG_NETW, "HXWinSockLib::Load(): loading lib");

    m_hLib = LoadLibrary(pszLibName);
    if(!m_hLib && pszAltLibName)
    {
        m_hLib = LoadLibrary(pszAltLibName);
    }

    if (m_hLib)
    {
        ++m_userCount;
        hr = HXR_OK;

        //
        // load required set of function pointers from library
        //
        LOAD_PROC(accept);
        LOAD_PROC(bind);
        LOAD_PROC(closesocket);
        LOAD_PROC(WSAStartup);
        LOAD_PROC(WSACleanup);
        LOAD_PROC(connect);
        LOAD_PROC(ioctlsocket);
        LOAD_PROC(getpeername);
        LOAD_PROC(getsockname);
        LOAD_PROC(getsockopt);
        LOAD_PROC(htonl);
        LOAD_PROC(htons);
        LOAD_PROC(inet_addr);
        LOAD_PROC(inet_ntoa);
        LOAD_PROC(listen);
        LOAD_PROC(ntohl);
        LOAD_PROC(ntohs);
        LOAD_PROC(recv);
        LOAD_PROC(recvfrom);
        LOAD_PROC(select);
        LOAD_PROC(send);
        LOAD_PROC(sendto);
        LOAD_PROC(setsockopt);
        LOAD_PROC(shutdown);
        LOAD_PROC(socket);
        LOAD_PROC(gethostbyaddr);
        LOAD_PROC(gethostbyname);
        LOAD_PROC(gethostname);
        LOAD_PROC(__WSAFDIsSet);

#if defined(_WINCE)
        LOAD_PROC(SetLastError);
        LOAD_PROC(GetLastError);
#endif

#if !defined(_WINCE)
        LOAD_PROC(getservbyport);
        LOAD_PROC(getservbyname);
        LOAD_PROC(getprotobynumber);
        LOAD_PROC(getprotobyname);

        LOAD_PROC(WSASetLastError);
        LOAD_PROC(WSAGetLastError);
        //LOAD_PROC(WSAIsBlocking);
        //LOAD_PROC(WSAUnhookBlockingHook);
        //LOAD_PROC(WSASetBlockingHook);
        //LOAD_PROC(WSACancelBlockingCall);
        LOAD_PROC(WSAAsyncGetServByName);
        LOAD_PROC(WSAAsyncGetServByPort);
        LOAD_PROC(WSAAsyncGetProtoByName);
        LOAD_PROC(WSAAsyncGetProtoByNumber);
        LOAD_PROC(WSAAsyncGetHostByName);
        LOAD_PROC(WSAAsyncGetHostByAddr);
        LOAD_PROC(WSACancelAsyncRequest);
        LOAD_PROC(WSAAsyncSelect);
        LOAD_PROC(WSASend);
        LOAD_PROC(WSASendTo);
        LOAD_PROC(WSARecv);
        LOAD_PROC(WSARecvFrom);
        LOAD_PROC(WSAIoctl);
#endif
        
        // everything prior to this should be succeed even with ipv4-only WinSock support
        HX_ASSERT(HXR_OK == hr);

        if( HXR_OK == hr )
        {
            // optional IPv6 api
            LOAD_PROC(getaddrinfo);
            LOAD_PROC(getnameinfo);
            LOAD_PROC(freeaddrinfo);
            hr = WinsockInit();
        }

        if(FAILED(hr))
        {
            UnLoad();
        }

    }
    return hr;
}
cEntityManager::~cEntityManager() {
	UnLoad();
}
Transaction::~Transaction()
{
    UnLoad();
}
void MachOBinaryFile::Close()
{
    UnLoad();
}
Exemple #15
0
   CLibrary::~CLibrary()
   {
      TRACE_FUN( Routine, "CLibrary::~CLibrary" );

      UnLoad();
   }
Exemple #16
0
// \brief Load the config file (sounds.xml) for nav sounds
bool CGUIAudioManager::Load()
{
  CSingleLock lock(m_cs);
  UnLoad();

  m_strMediaDir = GetSoundSkinPath();
  if (m_strMediaDir.empty())
    return true;

  Enable(true);
  std::string strSoundsXml = URIUtils::AddFileToFolder(m_strMediaDir, "sounds.xml");

  //  Load our xml file
  CXBMCTinyXML xmlDoc;

  CLog::Log(LOGINFO, "Loading %s", strSoundsXml.c_str());

  //  Load the config file
  if (!xmlDoc.LoadFile(strSoundsXml))
  {
    CLog::Log(LOGNOTICE, "%s, Line %d\n%s", strSoundsXml.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
    return false;
  }

  TiXmlElement* pRoot = xmlDoc.RootElement();
  std::string strValue = pRoot->Value();
  if ( strValue != "sounds")
  {
    CLog::Log(LOGNOTICE, "%s Doesn't contain <sounds>", strSoundsXml.c_str());
    return false;
  }

  //  Load sounds for actions
  TiXmlElement* pActions = pRoot->FirstChildElement("actions");
  if (pActions)
  {
    TiXmlNode* pAction = pActions->FirstChild("action");

    while (pAction)
    {
      TiXmlNode* pIdNode = pAction->FirstChild("name");
      unsigned int id = ACTION_NONE;    // action identity
      if (pIdNode && pIdNode->FirstChild())
      {
        CActionTranslator::TranslateString(pIdNode->FirstChild()->Value(), id);
      }

      TiXmlNode* pFileNode = pAction->FirstChild("file");
      std::string strFile;
      if (pFileNode && pFileNode->FirstChild())
        strFile += pFileNode->FirstChild()->Value();

      if (id != ACTION_NONE && !strFile.empty())
      {
        std::string filename = URIUtils::AddFileToFolder(m_strMediaDir, strFile);
        IAESound *sound = LoadSound(filename);
        if (sound)
          m_actionSoundMap.insert(std::pair<int, IAESound *>(id, sound));
      }

      pAction = pAction->NextSibling();
    }
  }

  //  Load window specific sounds
  TiXmlElement* pWindows = pRoot->FirstChildElement("windows");
  if (pWindows)
  {
    TiXmlNode* pWindow = pWindows->FirstChild("window");

    while (pWindow)
    {
      int id = 0;

      TiXmlNode* pIdNode = pWindow->FirstChild("name");
      if (pIdNode)
      {
        if (pIdNode->FirstChild())
          id = CWindowTranslator::TranslateWindow(pIdNode->FirstChild()->Value());
      }

      CWindowSounds sounds;
      sounds.initSound   = LoadWindowSound(pWindow, "activate"  );
      sounds.deInitSound = LoadWindowSound(pWindow, "deactivate");

      if (id > 0)
        m_windowSoundMap.insert(std::pair<int, CWindowSounds>(id, sounds));

      pWindow = pWindow->NextSibling();
    }
  }

  return true;
}
Exemple #17
0
void HoldBuildUI::LoadFinish()
{
    m_TiledIdx =  m_LoadPram.asInt();
    TiledMapUI::getInstance()->SetTouchEnabled(false);
    MsgListNode::getInstance()->LoadMsg(m_RootWidget);
    
    auto layout_Bottom = m_RootWidget->getChildByName<Layout*>("Layout_Bottom");
    
    auto btn_Close = layout_Bottom->getChildByName<Button*>("Btn_Close");
    auto langId = (int)LanguageIdEnum::CloseLangId;
    auto langText = MultiLanguage::getInstance()->GetText(langId);
    btn_Close->setTitleText(langText);
    
    auto btn_Collect = layout_Bottom->getChildByName<Button*>("Btn_Collect");
    langId = (int)LanguageIdEnum::PickUpAllLangId;
    langText = MultiLanguage::getInstance()->GetText(langId);
    btn_Collect->setTitleText(langText);

    btn_Close->addClickEventListener([this](Ref* sender)
     {
         SaveBagItem(); UnLoad();
         MapUI::getInstance()->ShowBreadNum();
         TiledMapUI::getInstance()->UpdateBuildStatus(m_TiledIdx, TiledMapUI::BuildStatus::Visit);
         
     });
    
    btn_Collect->addClickEventListener([this](Ref* sender)
       {
           
           auto nowNum = GetBagItemNum();
           
           auto bag_maxNum = UserData::getInstance()->GetUserData(UserDataEnum::BackPackMaxNum)->asInt();
           
           auto saveItemNum = bag_maxNum - nowNum;
           
           auto iter = m_DropItem->begin();
           while (iter != m_DropItem->end())
           {
               int cfgId = iter->first;
               if (cfgId == (int)CfgIdEnum::GoldId)
               {
                   SaveGold(); continue;
               }
               
               CfgDataRow dropItem(cfgId);
               // 是否占据背包格子,1:占据
               bool isOcy = dropItem.GetValue(CfgField::NonSpace)->asInt() == 1;
               
               if (saveItemNum <= 0 && isOcy)
               {
                   auto langId = (int)LanguageIdEnum::BakcPackSpaceNotEnoughId;
                   auto langText = MultiLanguage::getInstance()->GetText(langId);
                   //背包 空间不够
                   MoveText::getInstance()->AddDefaultTextData(m_RootWidget, langText);
                   break;
               }
               
               auto bag_Iter = m_BagItem->begin();
               while (bag_Iter != m_BagItem->end())
               {
                   if (bag_Iter->first == cfgId)
                   {
                       break;
                   }
                   bag_Iter++;
               }
               
               if (bag_Iter == m_BagItem->end())
               {
                   //背包里没有这种物品
                   if (!isOcy) {
                       m_BagItem->push_back(pair<int, int>(cfgId, iter->second));
                       iter = m_DropItem->erase(iter);
                   }
                   else {
                       if (iter->second <= saveItemNum)
                       {
                           saveItemNum -= iter->second;
                           //背包空间不够保存一部分物品
                           m_BagItem->push_back(pair<int, int>(cfgId, iter->second));
                           iter = m_DropItem->erase(iter);
                       }else
                       {
                           m_BagItem->push_back(pair<int, int>(cfgId, saveItemNum));
                           iter->second -= saveItemNum;
                           saveItemNum = 0;
                       }
                   }
                   
               }else
               {
                   //背包里有这种物品
                   if (!isOcy) {
                       bag_Iter->second += iter->second;
                       iter = m_DropItem->erase(iter);
                   }
                   else {
                       if (iter->second <= saveItemNum)
                       {
                           saveItemNum -= iter->second;
                           bag_Iter->second += iter->second;
                           iter = m_DropItem->erase(iter);
                       }else
                       {
                           bag_Iter->second += saveItemNum;
                           //背包空间不够保存一部分物品保存一部分到背包
                           iter->second -= saveItemNum; saveItemNum = 0;
                       }
                   }
               }
           }
           
           ShowItemList(m_BagItem, true);
           ShowItemList(m_DropItem, false);
       });
    
}
void DOS4GWBinaryFile::Close() {
    UnLoad();
}
Exemple #19
0
CPicture::~CPicture()
{
	UnLoad();
}
Exemple #20
0
bool CDynamicLibrary::Load(const char* sLibName, bool bTry)
{
	UnLoad();
	m_pLib = CShareLibraryManager::GetInstance()->Load(sLibName, bTry);
	return (m_pLib!=NULL);
}
Exemple #21
0
CSoundEffect::~CSoundEffect()
{
    UnLoad();
}
int gxConfig::ReLoad(const gxString &fname)
{
  UnLoad();
  return Load(fname);
}
Exemple #23
0
	Lump::~Lump()
	{
		UnLoad();
	}
int gxConfig::ReLoad()
{
  UnLoad();
  return Load();
}
SceneManager::~SceneManager()
{
	UnLoad();
}
Exemple #26
0
 CSDXMLFile::~CSDXMLFile()
 {
     UnLoad();
 }
WiredLADSPAInstance::~WiredLADSPAInstance()
{
	UnLoad();
}