예제 #1
0
파일: Image.cpp 프로젝트: danielytics/ouzel
        bool Image::initFromFile(const std::string& newFilename)
        {
            filename = newFilename;

            std::vector<uint8_t> newData;
            if (!sharedEngine->getFileSystem()->loadFile(newFilename, newData))
            {
                return false;
            }

            return initFromData(newData);
        }
예제 #2
0
파일: init.cpp 프로젝트: Eltamih/uvudec
/*
file: data file to target
architecture: hint about what we are trying to disassemble
*/
uv_err_t UVD::initFromFileName(const std::string &file, const UVDRuntimeHints &hints)
{
	uv_err_t rcTemp = UV_ERR_GENERAL;
	UVDData *data = NULL;
	
	uv_assert_err_ret(initEarly());
		
	rcTemp = UVDDataFile::getUVDDataFile(&data, file);
	if( UV_FAILED(rcTemp) || !data )
	{
		printf_error("could not open file: %s\n", file.c_str());
		return UV_DEBUG(UV_ERR_GENERAL);
	}
	uv_assert_err(initFromData(data, hints));
	return UV_ERR_OK;

error:
	delete data;
	return UV_DEBUG(UV_ERR_GENERAL);
}
예제 #3
0
void Cinema::requestFinished()
{
	if (request_.isNull()) {
		return;
	}

	if (!request_->error()) {
		if (request_->type() == "cinema_details") {
			QString xml = request_->result();
			delete request_;

			initFromData(xml);
		}
		else if (request_->type() == "geocoder") {
			Geocoder* geocoder = dynamic_cast<Geocoder*>(request_.data());
			if (geocoder) {
				ll_ = geocoder->ll();
				finishedProgress_ = 100;
				emit dataChanged();
			}
		}
	}
}
 /// Constructor.
 ///
 /// \param data Frame data.
 /// \param bone_amount Amount of bone elements.
 AnimationFrame(const int16_t *data, unsigned bone_amount, float scale = 1.0f)
 {
   initFromData(data, bone_amount, scale);
 }