Merge branch 'master' into blender2.8

Conflicts:
	source/blender/blenlib/BLI_math_matrix.h
	source/blender/blenlib/intern/math_matrix.c
	source/blender/blenlib/intern/rand.c
	source/blender/editors/animation/anim_channels_edit.c
	source/blender/makesrna/intern/rna_mask.c
This commit is contained in:
2017-11-15 10:46:19 +01:00
27 changed files with 66 additions and 60 deletions

View File

@@ -28,7 +28,7 @@
#define __EIGEN3_EIGENVALUES_C_API_CC__
/* Eigen gives annoying huge amount of warnings here, silence them! */
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic ignored "-Wlogical-op"
#endif

View File

@@ -28,7 +28,7 @@
#define __EIGEN3_SVD_C_API_CC__
/* Eigen gives annoying huge amount of warnings here, silence them! */
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic ignored "-Wlogical-op"
#endif

View File

@@ -48,27 +48,27 @@ template < class T > inline void CLAMP( T &a, T b=0., T c=1.) {
if(a>c) { a=c; return; }
}
template < class T > inline T MIN( T a, T b) {
template < class T > inline T MIN( const T& a, const T& b) {
return (a < b) ? a : b;
}
template < class T > inline T MAX( T a, T b) {
template < class T > inline T MAX( const T& a, const T& b) {
return (a > b) ? a : b;
}
template < class T > inline T MAX3( T a, T b, T c) {
template < class T > inline T MAX3( const T& a, const T& b, const T& c) {
T max = (a > b) ? a : b;
max = (max > c) ? max : c;
return max;
}
template < class T > inline float MAX3V( T vec) {
template < class T > inline float MAX3V( const T& vec) {
float max = (vec[0] > vec[1]) ? vec[0] : vec[1];
max = (max > vec[2]) ? max : vec[2];
return max;
}
template < class T > inline float MIN3V( T vec) {
template < class T > inline float MIN3V( const T& vec) {
float min = (vec[0] < vec[1]) ? vec[0] : vec[1];
min = (min < vec[2]) ? min : vec[2];
return min;

View File

@@ -245,7 +245,7 @@ void WTURBULENCE::initBlenderRNA(float *strength)
// Takes the one-sided finite difference in both directions and
// selects the smaller of the two
//////////////////////////////////////////////////////////////////////
static float minDx(int x, int y, int z, float* input, Vec3Int res)
static float minDx(int x, int y, int z, float* input, const Vec3Int& res)
{
const int index = x + y * res[0] + z * res[0] * res[1];
const int maxx = res[0]-2;
@@ -280,7 +280,7 @@ static float minDx(int x, int y, int z, float* input, Vec3Int res)
// Takes the one-sided finite difference in both directions and
// selects the smaller of the two
//////////////////////////////////////////////////////////////////////
static float minDy(int x, int y, int z, float* input, Vec3Int res)
static float minDy(int x, int y, int z, float* input, const Vec3Int& res)
{
const int index = x + y * res[0] + z * res[0] * res[1];
const int maxy = res[1]-2;
@@ -314,7 +314,7 @@ static float minDy(int x, int y, int z, float* input, Vec3Int res)
// Takes the one-sided finite difference in both directions and
// selects the smaller of the two
//////////////////////////////////////////////////////////////////////
static float minDz(int x, int y, int z, float* input, Vec3Int res)
static float minDz(int x, int y, int z, float* input, const Vec3Int& res)
{
const int slab = res[0]*res[1];
const int index = x + y * res[0] + z * slab;
@@ -605,7 +605,7 @@ Vec3 WTURBULENCE::WVelocity(Vec3 orgPos)
//////////////////////////////////////////////////////////////////////////////////////////
// Evaluate derivatives with Jacobian
//////////////////////////////////////////////////////////////////////////////////////////
Vec3 WTURBULENCE::WVelocityWithJacobian(Vec3 orgPos, float* xUnwarped, float* yUnwarped, float* zUnwarped)
Vec3 WTURBULENCE::WVelocityWithJacobian(const Vec3& orgPos, float* xUnwarped, float* yUnwarped, float* zUnwarped)
{
// arbitrarily offset evaluation points
const Vec3 p1 = orgPos + Vec3(NOISE_TILE_SIZE/2.0,0,0);

View File

@@ -62,7 +62,7 @@ struct WTURBULENCE
// evaluate wavelet noise function
Vec3 WVelocity(Vec3 p);
Vec3 WVelocityWithJacobian(Vec3 p, float* xUnwarped, float* yUnwarped, float* zUnwarped);
Vec3 WVelocityWithJacobian(const Vec3& p, float* xUnwarped, float* yUnwarped, float* zUnwarped);
// access functions
inline float* getDensityBig() { return _densityBig; }

View File

@@ -25,7 +25,7 @@
#include "abc_object.h"
struct AbcMeshWriter;
class AbcMeshWriter;
struct Main;
struct MetaBall;
struct Object;

View File

@@ -52,11 +52,10 @@
#include "MEM_guardedalloc.h"
#include "IMB_imbuf_types.h"
#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"
#include "BLI_utildefines.h"
#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"
#include "BKE_global.h"
void printfGlyph(bmGlyph *glyph)

View File

@@ -34,14 +34,14 @@
#include "DNA_freestyle_types.h"
#include "DNA_group_types.h"
#include "BKE_freestyle.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_string_utils.h"
#include "BKE_freestyle.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
// function declarations
static FreestyleLineSet *alloc_lineset(void);
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset, const int flag);

View File

@@ -29,14 +29,14 @@
#include <stdlib.h>
#include <string.h>
#include "BKE_outliner_treehash.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_mempool.h"
#include "DNA_outliner_types.h"
#include "BKE_outliner_treehash.h"
#include "MEM_guardedalloc.h"
typedef struct TseGroup {

View File

@@ -111,8 +111,10 @@ void BLI_mutex_unlock(ThreadMutex *mutex);
/* Spin Lock */
#ifdef __APPLE__
#if defined(__APPLE__)
typedef OSSpinLock SpinLock;
#elif defined(_MSC_VER)
typedef volatile int SpinLock;
#else
typedef pthread_spinlock_t SpinLock;
#endif

View File

@@ -453,4 +453,4 @@ void BLI_hammersley_2D_sequence(unsigned int n, double *r)
r[s * 2 + 0] = (double)(s + 0.5) / (double)n;
r[s * 2 + 1] = radical_inverse(s);
}
}
}

View File

@@ -472,8 +472,10 @@ void BLI_mutex_free(ThreadMutex *mutex)
void BLI_spin_init(SpinLock *spin)
{
#ifdef __APPLE__
#if defined(__APPLE__)
*spin = OS_SPINLOCK_INIT;
#elif defined(_MSC_VER)
*spin = 0;
#else
pthread_spin_init(spin, 0);
#endif
@@ -481,8 +483,14 @@ void BLI_spin_init(SpinLock *spin)
void BLI_spin_lock(SpinLock *spin)
{
#ifdef __APPLE__
#if defined(__APPLE__)
OSSpinLockLock(spin);
#elif defined(_MSC_VER)
while (InterlockedExchangeAcquire(spin, 1)) {
while (*spin) {
/* pass */
}
}
#else
pthread_spin_lock(spin);
#endif
@@ -490,23 +498,24 @@ void BLI_spin_lock(SpinLock *spin)
void BLI_spin_unlock(SpinLock *spin)
{
#ifdef __APPLE__
#if defined(__APPLE__)
OSSpinLockUnlock(spin);
#elif defined(_MSC_VER)
_ReadWriteBarrier();
*spin = 0;
#else
pthread_spin_unlock(spin);
#endif
}
#ifndef __APPLE__
void BLI_spin_end(SpinLock *spin)
{
pthread_spin_destroy(spin);
}
#if defined(__APPLE__)
#elif defined(_MSC_VER)
#else
void BLI_spin_end(SpinLock *UNUSED(spin))
{
}
pthread_spin_destroy(spin);
#endif
}
/* Read/Write Mutex Lock */

View File

@@ -37,7 +37,6 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BKE_library.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
@@ -54,6 +53,7 @@
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
#include "BKE_context.h"
#include "BKE_library.h"
#include "BKE_mask.h"
#include "BKE_global.h"
#include "BKE_scene.h"

View File

@@ -378,13 +378,6 @@ void ED_keymap_object(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "clear_delta", false);
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_location_clear", GKEY, KM_PRESS, KM_ALT | KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "clear_delta", true);
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_rotation_clear", RKEY, KM_PRESS, KM_ALT | KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "clear_delta", true);
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_scale_clear", SKEY, KM_PRESS, KM_ALT | KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "clear_delta", true);
WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0);
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);

View File

@@ -33,13 +33,13 @@
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_paint.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "ED_paint.h"
#include "ED_view3d.h"

View File

@@ -34,10 +34,10 @@
#ifdef RNA_RUNTIME
#include "BKE_cachefile.h"
#include "BLI_string.h"
#include "BKE_cachefile.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"

View File

@@ -52,14 +52,14 @@
#ifdef RNA_RUNTIME
#include "BLI_math.h"
#include "DNA_movieclip_types.h"
#include "BKE_mask.h"
#include "DEG_depsgraph.h"
#include "BLI_math.h"
#include "RNA_access.h"
#include "WM_api.h"

View File

@@ -27,6 +27,8 @@
#include <stdlib.h>
#include "BLI_utildefines.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -46,7 +48,6 @@
#include "WM_api.h"
#include "WM_types.h"
#include "BLI_utildefines.h"
#include "bmesh.h"
static const EnumPropertyItem particle_edit_hair_brush_items[] = {

View File

@@ -29,6 +29,9 @@
#include <stdlib.h>
#include <limits.h>
#include "BLI_sys_types.h"
#include "BLI_threads.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -38,8 +41,6 @@
#include "BKE_smoke.h"
#include "BKE_pointcache.h"
#include "BLI_threads.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"

View File

@@ -32,7 +32,7 @@
* \ingroup bph
*/
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic push
/* XXX suppress verbose warnings in eigen */
# pragma GCC diagnostic ignored "-Wlogical-op"

View File

@@ -39,7 +39,7 @@
#ifdef __GNUC__
# pragma GCC diagnostic push
/* XXX suppress verbose warnings in eigen */
# pragma GCC diagnostic ignored "-Wlogical-op"
//# pragma GCC diagnostic ignored "-Wlogical-op"
#endif
#ifndef IMPLICIT_ENABLE_EIGEN_DEBUG

View File

@@ -28,13 +28,14 @@
#include <Python.h>
#include "BLI_utildefines.h"
#include "RNA_types.h"
#include "bpy_rna.h"
#include "BKE_global.h"
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"

View File

@@ -36,7 +36,6 @@
#include "MEM_guardedalloc.h"
#include "BKE_appdir.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_hash_md5.h"
@@ -45,6 +44,7 @@
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BKE_appdir.h"
#include "BKE_image.h"
#include "BKE_global.h"
#include "BKE_main.h"