diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-05-14 01:22:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-05-14 01:22:15 -0300 |
commit | b324ff7ea584676fcc3292808d7e7ea609982f8e (patch) | |
tree | b80e9aa0b8f2926a398e25ef904f6229cb3e28dd /core/bind | |
parent | 45a509282e912d85c46b40974a2deb926be5be42 (diff) |
A bit of everything:
-IMA-ADPCM support for samples, this means that sound effects can be compressed and use 4 timess less RAM.
-New 3D import workflow based on Wavefront OBJ. Import single objects as mesh resources instead of full scenes. Many people prefers to work this way. Just like the rest of the imported resources, these are updated in realtime if modified externally.
-Mesh resources now support naming surfaces. This helps reimporting to identify which user-created materials must be kept.
-Several fixes and improvements to SurfaceTool.
-Anti Aliasing added to WorldEnvironment effects (using FXAA)
-2D Physics bodies (RigidBody, KinematicBody, etc), Raycasts, Tilemap, etc support collision layers. This makes easy to group which objects collide against which.
-2D Trigger shapes can now also trigger collision reporting in other 2D bodies (it used to be in Area2D before)
-Viewport render target textures can now be filtered.
-Few fixes in GDscript make it easier to work with static functions and class members.
-Several and many bugfixes.
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 51 | ||||
-rw-r--r-- | core/bind/core_bind.h | 3 |
2 files changed, 50 insertions, 4 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index fd6a91d125..ec159da00f 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -479,10 +479,54 @@ void _OS::print_all_textures_by_size() { print_line(E->get().path+" - "+String::humanize_size(E->get().vram)+" ("+E->get().size+") - total:"+String::humanize_size(total) ); total-=E->get().vram; } +} +void _OS::print_resources_by_type(const Vector<String>& p_types) { + Map<String,int> type_count; + + List<Ref<Resource> > resources; + ResourceCache::get_cached_resources(&resources); + + List<Ref<Resource> > rsrc; + ResourceCache::get_cached_resources(&rsrc); + + for (List<Ref<Resource> >::Element *E=rsrc.front();E;E=E->next()) { + + Ref<Resource> r = E->get(); + + bool found = false; + + for (int i=0; i<p_types.size(); i++) { + if (r->is_type(p_types[i])) + found = true; + } + if (!found) + continue; + + if (!type_count.has(r->get_type())) { + type_count[r->get_type()]=0; + } + + + type_count[r->get_type()]++; + + print_line(r->get_type()+": "+r->get_path()); + + List<String> metas; + r->get_meta_list(&metas); + for (List<String>::Element* me = metas.front(); me; me = me->next()) { + print_line(" "+String(me->get()) + ": " + r->get_meta(me->get())); + }; + } + + for(Map<String,int>::Element *E=type_count.front();E;E=E->next()) { + + print_line(E->key()+" count: "+itos(E->get())); + } + +}; -} void _OS::print_all_resources(const String& p_to_file ) { @@ -509,9 +553,9 @@ float _OS::get_frames_per_second() const { return OS::get_singleton()->get_frames_per_second(); } -Error _OS::native_video_play(String p_path) { +Error _OS::native_video_play(String p_path, float p_volume) { - return OS::get_singleton()->native_video_play(p_path); + return OS::get_singleton()->native_video_play(p_path, p_volume); }; bool _OS::native_video_is_playing() { @@ -614,6 +658,7 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); + ObjectTypeDB::bind_method(_MD("print_resources_by_type"),&_OS::print_resources_by_type); ObjectTypeDB::bind_method(_MD("native_video_play"),&_OS::native_video_play); ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index f5c94dcf06..18eb594760 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -98,7 +98,7 @@ public: bool is_video_mode_resizable(int p_screen=0) const; Array get_fullscreen_mode_list(int p_screen=0) const; - Error native_video_play(String p_path); + Error native_video_play(String p_path, float p_volume); bool native_video_is_playing(); void native_video_pause(); void native_video_stop(); @@ -139,6 +139,7 @@ public: void print_resources_in_use(bool p_short=false); void print_all_resources(const String& p_to_file); void print_all_textures_by_size(); + void print_resources_by_type(const Vector<String>& p_types); bool has_touchscreen_ui_hint() const; |