Ejemplo n.º 1
0
bool GLES2Texture::LoadTexture(
	VideoWeakPtr video,
	const str_type::string& fileName,
	Color mask,
	const unsigned int width,
	const unsigned int height,
	const unsigned int nMipMaps)
{
	m_logger.Log(str_type::string("\n___________________\n") + fileName + " loading texture...", Platform::FileLogger::INFO);

	m_fileName = fileName;
	Platform::FileBuffer out;
	m_fileManager->GetFileBuffer(fileName, out);
	if (!out)
	{
		m_logger.Log(fileName + " could not load buffer", Platform::FileLogger::ERROR);
		return false;
	}
	return LoadTexture(video, out->GetAddress(), mask, width, height, nMipMaps, out->GetBufferSize());
}
Ejemplo n.º 2
0
bool AudiereSample::LoadSampleFromFile(AudioWeakPtr audio, const std::wstring& fileName,
									   const Platform::FileManagerPtr& fileManager, const GS_SAMPLE_TYPE type)
{
	Platform::FileBuffer out;
	fileManager->GetFileBuffer(fileName, out);
	bool r = false;

	if (out)
	{
		r = LoadSampleFromFileInMemory(audio, out->GetAddress(), out->GetBufferSize(), type);
	}

	if (!r)
	{
		std::wstringstream ss;
		ss << L"Failed while loading the file: " << fileName;
		ShowMessage(ss);
		return false;
	}
	return r;
}