Exemplo n.º 1
0
RES ResourceFormatLoaderVideoStreamTheora::load(const String &p_path, const String &p_original_path, Error *r_error) {
	if (r_error)
		*r_error = ERR_FILE_CANT_OPEN;

	VideoStreamTheora *stream = memnew(VideoStreamTheora);
	stream->set_file(p_path);

	if (r_error)
		*r_error = OK;

	return Ref<VideoStreamTheora>(stream);
}
Exemplo n.º 2
0
RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_original_path, Error *r_error) {

	FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
	if (!f) {
		if (r_error) {
			*r_error = ERR_CANT_OPEN;
		}
		memdelete(f);
		return RES();
	}

	VideoStreamTheora *stream = memnew(VideoStreamTheora);
	stream->set_file(p_path);

	Ref<VideoStreamTheora> ogv_stream = Ref<VideoStreamTheora>(stream);

	if (r_error) {
		*r_error = OK;
	}

	return ogv_stream;
}
Exemplo n.º 3
0
RES ResourceFormatLoaderVideoStreamTheora::load(const String &p_path,const String& p_original_path) {

	VideoStreamTheora *stream = memnew(VideoStreamTheora);
	stream->set_file(p_path);
	return Ref<VideoStreamTheora>(stream);
}