Explorar el Código

Merge branch 'master' of https://github.com/godotengine/godot

Juan Linietsky hace 9 años
padre
commit
5e2f327d4b

+ 1 - 1
core/io/resource_format_binary.cpp

@@ -905,7 +905,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
 
 		error=ERR_FILE_UNRECOGNIZED;
 		ERR_EXPLAIN("Unrecognized binary resource file: "+local_path);
-		ERR_FAIL_V();
+		ERR_FAIL();
 	}
 
 	bool big_endian = f->get_32();

+ 7 - 0
core/variant_call.cpp

@@ -858,6 +858,11 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
 		r_ret=Transform(p_args[0]->operator Matrix3(),p_args[1]->operator Vector3());
 	}
 
+	static void Image_init1(Variant& r_ret, const Variant** p_args) {
+
+		r_ret=Image(*p_args[0],*p_args[1],*p_args[2],Image::Format(p_args[3]->operator int()));
+	}
+
 	static void add_constructor(VariantConstructFunc p_func,const Variant::Type p_type,
 			const String& p_name1="", const Variant::Type p_type1=Variant::NIL,
 			const String& p_name2="", const Variant::Type p_type2=Variant::NIL,
@@ -1583,6 +1588,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
 	_VariantCall::add_constructor(_VariantCall::Transform_init1,Variant::TRANSFORM,"x_axis",Variant::VECTOR3,"y_axis",Variant::VECTOR3,"z_axis",Variant::VECTOR3,"origin",Variant::VECTOR3);
 	_VariantCall::add_constructor(_VariantCall::Transform_init2,Variant::TRANSFORM,"basis",Variant::MATRIX3,"origin",Variant::VECTOR3);
 
+	_VariantCall::add_constructor(_VariantCall::Image_init1,Variant::IMAGE,"width",Variant::INT,"height",Variant::INT,"mipmaps",Variant::BOOL,"format",Variant::INT);
+
 	/* REGISTER CONSTANTS */
 
 	_VariantCall::constant_data[Variant::VECTOR3].value["AXIS_X"]=Vector3::AXIS_X;

+ 15 - 0
doc/base/classes.xml

@@ -13147,6 +13147,21 @@ returns:= "username=user&password=pass"
 			<description>
 			</description>
 		</method>
+		<method name="Image">
+			<return type="Image">
+			</return>
+			<argument index="0" name="width" type="int">
+			</argument>
+			<argument index="1" name="height" type="int">
+			</argument>
+			<argument index="2" name="mipmaps" type="bool">
+			</argument>
+			<argument index="3" name="format" type="int">
+			</argument>
+			<description>
+			Create an empty image of a specific size and format.
+			</description>
+		</method>
 	</methods>
 	<constants>
 		<constant name="COMPRESS_BC" value="0">

+ 1 - 1
drivers/theora/video_stream_theora.cpp

@@ -411,6 +411,7 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
 		th_decode_ctl(td,TH_DECCTL_GET_PPLEVEL_MAX,&pp_level_max,
 					  sizeof(pp_level_max));
 		pp_level=pp_level_max;
+		pp_level=0;
 		th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level));
 		pp_inc=0;
 
@@ -620,7 +621,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
 
 					if(videobuf_time>=get_time()) {
 						frame_done=true;
-
 					} else{
 						/*If we are too slow, reduce the pp level.*/
 						pp_inc=pp_level>0?-1:0;

+ 3 - 3
drivers/theora/video_stream_theora.h

@@ -138,20 +138,20 @@ class VideoStreamTheora : public VideoStream {
 	OBJ_TYPE(VideoStreamTheora,VideoStream);
 
 	String file;
-    int audio_track;
+	int audio_track;
 
 
 public:
 
 	Ref<VideoStreamPlayback> instance_playback() {
 		Ref<VideoStreamPlaybackTheora> pb = memnew( VideoStreamPlaybackTheora );
-	pb->set_audio_track(audio_track);
+		pb->set_audio_track(audio_track);
 		pb->set_file(file);
 		return pb;
 	}
 
 	void set_file(const String& p_file) { file=p_file; }
-    void set_audio_track(int p_track) { audio_track=p_track; }
+	void set_audio_track(int p_track) { audio_track=p_track; }
 
     VideoStreamTheora() { audio_track=0; }
 

+ 0 - 1
platform/windows/detect.py

@@ -170,7 +170,6 @@ def get_flags():
 	return [
 		('freetype','builtin'), #use builtin freetype
 		('openssl','builtin'), #use builtin openssl
-		('theora','no'),
 	]
 			
 def build_res_file( target, source, env ):

+ 3 - 1
tools/editor/plugins/script_editor_plugin.cpp

@@ -1137,12 +1137,14 @@ void ScriptEditor::_menu_option(int p_option) {
 					return;
 				int line = tx->cursor_get_line();
 				int next_line = line + 1;
+				int column = tx->cursor_get_column();
 
-				if (line == tx->get_line_count() - 1 || next_line >= tx->get_line_count())
+				if (line >= tx->get_line_count() - 1)
 					tx->set_line(line, tx->get_line(line) + "\n");
 
 				String line_clone = tx->get_line(line);
 				tx->insert_at(line_clone, next_line);
+				tx->cursor_set_column(column);
 				tx->update();
 
 			} break;