diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-02-02 08:18:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 08:18:42 +0100 |
commit | 40e4c1f6abbe5569a3c2f91d48b9770c8e97ea0d (patch) | |
tree | 12ba447a51df6e9a21d34df6ffdca8b1595e3f96 /core | |
parent | 869d710198af9eb3dfee3e167cb432389d04f76d (diff) | |
parent | e06edc67c049c65c3952a8447e22717a0f492020 (diff) |
Merge pull request #7689 from eska014/webgl2
Enable WebGL2 in web export, start fixing build
Diffstat (limited to 'core')
-rw-r--r-- | core/class_db.cpp | 5 | ||||
-rw-r--r-- | core/safe_refcount.cpp | 8 | ||||
-rw-r--r-- | core/vector.h | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index bb3368c128..2a3a12b127 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -33,6 +33,7 @@ #ifdef NO_THREADS #define OBJTYPE_RLOCK +#define OBJTYPE_WLOCK #else @@ -776,11 +777,15 @@ void ClassDB::add_property(StringName p_class,const PropertyInfo& p_pinfo, const +#ifndef NO_THREADS lock->read_lock(); +#endif ClassInfo *type=classes.getptr(p_class); +#ifndef NO_THREADS lock->read_unlock(); +#endif ERR_FAIL_COND(!type); diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index ede37bbe8a..50617f2062 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -44,6 +44,14 @@ uint32_t atomic_conditional_increment( register uint32_t * pw ) { return *pw; } +uint32_t atomic_increment( register uint32_t * pw ) { + + (*pw)++; + + return *pw; + +} + uint32_t atomic_decrement( register uint32_t * pw ) { (*pw)--; diff --git a/core/vector.h b/core/vector.h index 3119657cbb..1cb3fee256 100644 --- a/core/vector.h +++ b/core/vector.h @@ -81,7 +81,7 @@ class Vector { size_t p; if (_mul_overflow(p_elements, sizeof(T), &o)) return false; *out = nearest_power_of_2(o); - if (_add_overflow(o, 32, &p)) return false; //no longer allocated here + if (_add_overflow(o, static_cast<size_t>(32), &p)) return false; //no longer allocated here return true; #else // Speed is more important than correctness here, do the operations unchecked |