Esempio n. 1
0
//--------------------------------------------------------------------------
void VeResource::LoadAsync() noexcept
{
	if (m_eState == LOADED)
	{
		Hold();
	}
	else
	{
		m_eState = LOADING;
		UpdateState();
	}
	ve_res_mgr.CacheFile(m_kName, m_spGroup, [this](
		VeResourceManager::FileCachePtr spCache) noexcept
	{
		if (spCache)
		{
			LoadImpl(spCache);
		}
		else
		{
			if (m_eState == LOADED)
			{
				Free();
			}
			else
			{
				m_eState = UNLOADED;
				UpdateState();
			}
			OnResLoadFailed(ERR_FILE_NOT_FOUND);
		}
	});
}
Esempio n. 2
0
XLGP_ICON_HANDLE IconRes::GetIconHandle()
{
	if (!m_resLoaded)
	{
		m_resLoaded = true;
		assert(!m_resFolder.empty());
		
		LoadImpl(m_resFolder.c_str());
	}

	return m_iconHandle;
}
Esempio n. 3
0
//--------------------------------------------------------------------------
void VeResource::Load() noexcept
{
	if (m_eState == UNLOADED || m_eState == LOADED)
	{
		auto spCache = ve_res_mgr.CacheFile(m_kName, m_spGroup);
		if (spCache)
		{
			LoadImpl(spCache);
		}
		else
		{
			OnResLoadFailed(ERR_FILE_NOT_FOUND);
		}
	}	
}
Esempio n. 4
0
void Config::LoadFile(std::wstring const& path)
{
  pugi::xml_document doc;
  auto const load_result = doc.load_file(path.c_str());
  if (!load_result)
  {
    HADESMEM_DETAIL_THROW_EXCEPTION(
      hadesmem::Error{}
      << hadesmem::ErrorString{"Loading XML file failed."}
      << hadesmem::ErrorCodeOther{static_cast<DWORD_PTR>(load_result.status)}
      << hadesmem::ErrorStringOther{load_result.description()});
  }

  LoadImpl(doc);
}
void GazeboRosThermalCamera_<Base>::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
{
  Base::Load(_parent, _sdf);
  // copying from CameraPlugin into GazeboRosCameraUtils
  this->parentSensor_ = this->parentSensor;
  this->width_ = this->width;
  this->height_ = this->height;
  this->depth_ = this->depth;
  this->format_ = this->format;

  this->image_connect_count_ = boost::shared_ptr<int>(new int);
  *this->image_connect_count_ = 0;
  this->image_connect_count_lock_ = boost::shared_ptr<boost::mutex>(new boost::mutex);
  this->was_active_ = boost::shared_ptr<bool>(new bool);
  *this->was_active_ = false;

  LoadImpl(_parent, _sdf);
  GazeboRosCameraUtils::Load(_parent, _sdf);
}
Esempio n. 6
0
void Texture::Load( const char *szFile, int framesCount /*= 1*/ )
{
  ASSERT( szFile != 0 );
  
  SDL_Surface* pSurf = 0;

  if( boost::algorithm::ends_with(szFile, ".bmp") )
    pSurf = SDL_LoadBMP(szFile);
  else
  {
    //This function makes texture prepared for premultiplied alpha blending only on MacOS!
    pSurf = IMG_Load(szFile);  
  }
    
  if( pSurf == 0 ) 
    LOG_FATAL( FMT("Texture loading error: %s") % szFile ); 
  
  LoadImpl( pSurf, framesCount );  
}
Esempio n. 7
0
bool IconRes::LoadRes(const wchar_t* lpResFolder)
{
	assert(lpResFolder);
	assert(!m_resLoaded);
	
	if (lpResFolder != NULL)
	{
		m_resFolder = lpResFolder;
	}

	if (m_iconHandle != NULL)
	{
		FreeImpl();
	}

	m_resLoaded = true;
	
	bool ret = LoadImpl(lpResFolder);
	assert(ret);

	return ret;
}
Esempio n. 8
0
void Texture::Reset( SDL_Surface *pSurf )
{
  LoadImpl( pSurf, 1 );
}