Skip to content

Commit fbdd925

Browse files
committed
-Work in progress visual shader editor *DOES NOT WORK YET*
1 parent eb1f978 commit fbdd925

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4385
-1970
lines changed

core/method_bind.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class MethodBind {
178178
#ifdef DEBUG_METHODS_ENABLED
179179

180180
_FORCE_INLINE_ void set_return_type(const StringName& p_type) { ret_type=p_type; }
181+
_FORCE_INLINE_ StringName get_return_type() const { return ret_type; }
181182

182183
_FORCE_INLINE_ Variant::Type get_argument_type(int p_argument) const {
183184

core/object_type_db.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co
191191

192192
HashMap<StringName,ObjectTypeDB::TypeInfo,StringNameHasher> ObjectTypeDB::types;
193193
HashMap<StringName,StringName,StringNameHasher> ObjectTypeDB::resource_base_extensions;
194+
HashMap<StringName,StringName,StringNameHasher> ObjectTypeDB::compat_types;
194195

195196
ObjectTypeDB::TypeInfo::TypeInfo() {
196197

@@ -263,12 +264,22 @@ bool ObjectTypeDB::type_exists(const String &p_type) {
263264
return types.has(p_type);
264265
}
265266

267+
void ObjectTypeDB::add_compatibility_type(const StringName& p_type,const StringName& p_fallback) {
268+
269+
compat_types[p_type]=p_fallback;
270+
}
271+
266272
Object *ObjectTypeDB::instance(const String &p_type) {
267273

268274
TypeInfo *ti;
269275
{
270276
OBJTYPE_LOCK;
271277
ti=types.getptr(p_type);
278+
if (!ti || ti->disabled || !ti->creation_func) {
279+
if (compat_types.has(p_type)) {
280+
ti=types.getptr(compat_types[p_type]);
281+
}
282+
}
272283
ERR_FAIL_COND_V(!ti,NULL);
273284
ERR_FAIL_COND_V(ti->disabled,NULL);
274285
ERR_FAIL_COND_V(!ti->creation_func,NULL);
@@ -914,6 +925,7 @@ void ObjectTypeDB::cleanup() {
914925
}
915926
types.clear();
916927
resource_base_extensions.clear();
928+
compat_types.clear();
917929
}
918930

919931
//

core/object_type_db.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class ObjectTypeDB {
151151
static Mutex *lock;
152152
static HashMap<StringName,TypeInfo,StringNameHasher> types;
153153
static HashMap<StringName,StringName,StringNameHasher> resource_base_extensions;
154+
static HashMap<StringName,StringName,StringNameHasher> compat_types;
154155

155156
#ifdef DEBUG_METHODS_ENABLED
156157
static MethodBind* bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const MethodDefinition &method_name, const Variant **p_defs, int p_defcount);
@@ -482,6 +483,7 @@ class ObjectTypeDB {
482483
static void get_resource_base_extensions(List<String> *p_extensions);
483484
static void get_extensions_for_type(const StringName& p_type,List<String> *p_extensions);
484485

486+
static void add_compatibility_type(const StringName& p_type,const StringName& p_fallback);
485487
static void init();
486488
static void cleanup();
487489
};

demos/2d/platformer/player.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ var enemy
5353

5454
func _integrate_forces(s):
5555

56+
57+
5658
var lv = s.get_linear_velocity()
5759
var step = s.get_step()
5860

5961
var new_anim=anim
6062
var new_siding_left=siding_left
6163

64+
6265
# Get the controls
6366
var move_left = Input.is_action_pressed("move_left")
6467
var move_right = Input.is_action_pressed("move_right")

0 commit comments

Comments
 (0)