Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorMiika Hamalainen <blender@miikah.org>2012-08-10 20:23:54 +0400
committerMiika Hamalainen <blender@miikah.org>2012-08-10 20:23:54 +0400
commit35de87d10be269a76c1bfce2e685bc43544a6a04 (patch)
treed866376c25fdf901065d50b66419f6ba5e71c0ef /intern
parent49f0d0cc14ff074559cc6ae54ddc81d97f3b64b6 (diff)
parent35e4cfc6d647f8ba0253c6f2c48d879983ef59b4 (diff)
Merge with trunk r49776
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/app/cycles_test.cpp2
-rw-r--r--intern/cycles/blender/blender_object.cpp7
-rw-r--r--intern/cycles/blender/blender_particles.cpp12
-rw-r--r--intern/cycles/blender/blender_sync.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp4
-rw-r--r--intern/smoke/intern/WAVELET_NOISE.h2
-rw-r--r--intern/string/STR_HashedString.h82
8 files changed, 57 insertions, 56 deletions
diff --git a/intern/cycles/app/cycles_test.cpp b/intern/cycles/app/cycles_test.cpp
index f5890998adc..75f76efc8e1 100644
--- a/intern/cycles/app/cycles_test.cpp
+++ b/intern/cycles/app/cycles_test.cpp
@@ -245,7 +245,7 @@ static void options_parse(int argc, const char **argv)
NULL);
if(ap.parse(argc, argv) < 0) {
- fprintf(stderr, "%s\n", ap.error_message().c_str());
+ fprintf(stderr, "%s\n", ap.geterror().c_str());
ap.usage();
exit(EXIT_FAILURE);
}
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 242f7c8ecef..eb9cc7bc4de 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -247,8 +247,11 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
scene->object_manager->tag_update(scene);
}
+ /* updated dupli objects require particle sync */
+ bool need_particle_update = object_need_particle_update(b_ob);
+
/* object sync */
- if(object_updated || (object->mesh && object->mesh->need_update)) {
+ if(object_updated || (object->mesh && object->mesh->need_update) || need_particle_update) {
object->name = b_ob.name().c_str();
object->pass_id = b_ob.pass_index();
object->tfm = tfm;
@@ -275,7 +278,7 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
object->particle_id = particle_id;
/* particle sync */
- if (object_use_particles(b_ob))
+ if (need_particle_update)
sync_particles(object, b_ob);
object->tag_update(scene);
diff --git a/intern/cycles/blender/blender_particles.cpp b/intern/cycles/blender/blender_particles.cpp
index d669aa34a68..e32c80a51b5 100644
--- a/intern/cycles/blender/blender_particles.cpp
+++ b/intern/cycles/blender/blender_particles.cpp
@@ -31,7 +31,7 @@ CCL_NAMESPACE_BEGIN
/* Particles Sync */
-bool BlenderSync::object_use_particles(BL::Object b_ob)
+bool BlenderSync::object_need_particle_update(BL::Object b_ob)
{
/* Particle data is only needed for
* a) Billboard render mode if object's own material uses particle info
@@ -39,7 +39,7 @@ bool BlenderSync::object_use_particles(BL::Object b_ob)
*
* Note: Meshes have to be synced at this point!
*/
- bool use_particles = false;
+ bool need_update = false;
BL::Object::particle_systems_iterator b_psys;
for (b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys) {
@@ -54,7 +54,7 @@ bool BlenderSync::object_use_particles(BL::Object b_ob)
BL::ID key = (BKE_object_is_modified(b_ob))? b_ob: b_ob.data();
Mesh *mesh = mesh_map.find(key);
if (mesh) {
- use_particles |= mesh->need_attribute(scene, ATTR_STD_PARTICLE);
+ need_update |= mesh->need_attribute(scene, ATTR_STD_PARTICLE) && mesh->need_update;
}
break;
}
@@ -66,7 +66,7 @@ bool BlenderSync::object_use_particles(BL::Object b_ob)
BL::ID key = (BKE_object_is_modified(b_dupli_ob))? b_dupli_ob: b_dupli_ob.data();
Mesh *mesh = mesh_map.find(key);
if (mesh) {
- use_particles |= mesh->need_attribute(scene, ATTR_STD_PARTICLE);
+ need_update |= mesh->need_attribute(scene, ATTR_STD_PARTICLE) && mesh->need_update;
}
}
break;
@@ -80,7 +80,7 @@ bool BlenderSync::object_use_particles(BL::Object b_ob)
BL::ID key = (BKE_object_is_modified(*b_gob))? *b_gob: b_gob->data();
Mesh *mesh = mesh_map.find(key);
if (mesh) {
- use_particles |= mesh->need_attribute(scene, ATTR_STD_PARTICLE);
+ need_update |= mesh->need_attribute(scene, ATTR_STD_PARTICLE) && mesh->need_update;
}
}
}
@@ -93,7 +93,7 @@ bool BlenderSync::object_use_particles(BL::Object b_ob)
}
}
- return use_particles;
+ return need_update;
}
static bool use_particle_system(BL::ParticleSystem b_psys)
diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h
index 1a6c04db10c..6065235a278 100644
--- a/intern/cycles/blender/blender_sync.h
+++ b/intern/cycles/blender/blender_sync.h
@@ -92,7 +92,7 @@ private:
bool BKE_object_is_modified(BL::Object b_ob);
bool object_is_mesh(BL::Object b_ob);
bool object_is_light(BL::Object b_ob);
- bool object_use_particles(BL::Object b_ob);
+ bool object_need_particle_update(BL::Object b_ob);
int object_count_particles(BL::Object b_ob);
/* variables */
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 760dc0cbfd5..9f08f4cff80 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -527,7 +527,7 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
// So WM_exit needs to be called directly, as the event loop will never run before termination
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
- /*G.afbreek = 0; //Let Cocoa perform the termination at the end
+ /*G.is_break = FALSE; //Let Cocoa perform the termination at the end
WM_exit(C);*/
}
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index e8f172f8b1c..7ac9b0c3c24 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -152,7 +152,9 @@ GHOST_SystemX11::
~GHOST_SystemX11()
{
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
- XCloseIM(m_xim);
+ if (m_xim) {
+ XCloseIM(m_xim);
+ }
#endif
XCloseDisplay(m_display);
diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
index 4806c6a9fc1..fce901b68aa 100644
--- a/intern/smoke/intern/WAVELET_NOISE.h
+++ b/intern/smoke/intern/WAVELET_NOISE.h
@@ -107,7 +107,7 @@ static void downsampleNeumann(const float *from, float *to, int n, int stride)
// if these values are not local incorrect results are generated
float downCoeffs[32] = { DOWNCOEFFS };
const float *const aCoCenter= &downCoeffs[16];
- for (int i = 0; i < ceil((float)n / 2); i++) {
+ for (int i = 0; i <= n / 2; i++) {
to[i * stride] = 0;
for (int k = 2 * i - 16; k < 2 * i + 16; k++) {
// handle boundary
diff --git a/intern/string/STR_HashedString.h b/intern/string/STR_HashedString.h
index f56e365bdb3..8bfbde65895 100644
--- a/intern/string/STR_HashedString.h
+++ b/intern/string/STR_HashedString.h
@@ -27,14 +27,10 @@
/** \file string/STR_HashedString.h
* \ingroup string
- */
-
-
-/**
-
+ *
* Copyright (C) 2001 NaN Technologies B.V.
* This file was formerly known as: GEN_StdString.cpp.
- * @date November, 14, 2001
+ * \date November, 14, 2001
*/
#ifndef __STR_HASHEDSTRING_H__
@@ -53,22 +49,22 @@
//
static inline void STR_gHashMix(dword& a, dword& b, dword& c)
{
- a -= b; a -= c; a ^= (c>>13);
- b -= c; b -= a; b ^= (a<<8);
- c -= a; c -= b; c ^= (b>>13);
- a -= b; a -= c; a ^= (c>>12);
- b -= c; b -= a; b ^= (a<<16);
- c -= a; c -= b; c ^= (b>>5);
- a -= b; a -= c; a ^= (c>>3);
- b -= c; b -= a; b ^= (a<<10);
- c -= a; c -= b; c ^= (b>>15);
+ a -= b; a -= c; a ^= (c >> 13);
+ b -= c; b -= a; b ^= (a << 8);
+ c -= a; c -= b; c ^= (b >> 13);
+ a -= b; a -= c; a ^= (c >> 12);
+ b -= c; b -= a; b ^= (a << 16);
+ c -= a; c -= b; c ^= (b >> 5);
+ a -= b; a -= c; a ^= (c >> 3);
+ b -= c; b -= a; b ^= (a << 10);
+ c -= a; c -= b; c ^= (b >> 15);
}
//
// Fast Hashable<int32> functionality
// http://www.concentric.net/~Ttwang/tech/inthash.htm
//
-static inline dword STR_gHash(dword inDWord)
+static inline dword STR_gHash(dword inDWord)
{
dword key = inDWord;
key += ~(key << 16);
@@ -80,43 +76,43 @@ static inline dword STR_gHash(dword inDWord)
return key;
}
-enum { GOLDEN_RATIO = 0x9e3779b9 }; // arbitrary value to initialize hash funtion, well not so arbitrary
- // as this value is taken from the pigs library (Orange Games/Lost Boys)
+enum { GOLDEN_RATIO = 0x9e3779b9 }; /* arbitrary value to initialize hash funtion, well not so arbitrary
+ * as this value is taken from the pigs library (Orange Games/Lost Boys) */
-static dword STR_gHash(const void* in, int len, dword init_val)
+static dword STR_gHash(const void *in, int len, dword init_val)
{
- unsigned int length = len;
+ unsigned int length = len;
dword a = (dword)GOLDEN_RATIO;
dword b = (dword)GOLDEN_RATIO;
- dword c = init_val; // the previous hash value
+ dword c = init_val; /* the previous hash value */
byte *p_in = (byte *)in;
// Do the largest part of the key
while (length >= 12)
{
- a += (p_in[0] + ((dword)p_in[1]<<8) + ((dword)p_in[2] <<16) + ((dword)p_in[3] <<24));
- b += (p_in[4] + ((dword)p_in[5]<<8) + ((dword)p_in[6] <<16) + ((dword)p_in[7] <<24));
- c += (p_in[8] + ((dword)p_in[9]<<8) + ((dword)p_in[10]<<16) + ((dword)p_in[11]<<24));
+ a += (p_in[0] + ((dword)p_in[1] << 8) + ((dword)p_in[2] << 16) + ((dword)p_in[3] << 24));
+ b += (p_in[4] + ((dword)p_in[5] << 8) + ((dword)p_in[6] << 16) + ((dword)p_in[7] << 24));
+ c += (p_in[8] + ((dword)p_in[9] << 8) + ((dword)p_in[10] << 16) + ((dword)p_in[11] << 24));
STR_gHashMix(a, b, c);
p_in += 12; length -= 12;
}
// Handle the last 11 bytes
c += len;
- switch(length) {
- case 11: c+=((dword)p_in[10]<<24);
- case 10: c+=((dword)p_in[9]<<16);
- case 9 : c+=((dword)p_in[8]<<8); // the first byte of c is reserved for the length
- case 8 : b+=((dword)p_in[7]<<24);
- case 7 : b+=((dword)p_in[6]<<16);
- case 6 : b+=((dword)p_in[5]<<8);
- case 5 : b+=p_in[4];
- case 4 : a+=((dword)p_in[3]<<24);
- case 3 : a+=((dword)p_in[2]<<16);
- case 2 : a+=((dword)p_in[1]<<8);
- case 1 : a+=p_in[0];
+ switch (length) {
+ case 11: c += ((dword)p_in[10] << 24);
+ case 10: c += ((dword)p_in[9] << 16);
+ case 9: c += ((dword)p_in[8] << 8); /* the first byte of c is reserved for the length */
+ case 8: b += ((dword)p_in[7] << 24);
+ case 7: b += ((dword)p_in[6] << 16);
+ case 6: b += ((dword)p_in[5] << 8);
+ case 5: b += p_in[4];
+ case 4: a += ((dword)p_in[3] << 24);
+ case 3: a += ((dword)p_in[2] << 16);
+ case 2: a += ((dword)p_in[1] << 8);
+ case 1: a += p_in[0];
}
STR_gHashMix(a, b, c);
@@ -129,18 +125,18 @@ static dword STR_gHash(const void* in, int len, dword init_val)
class STR_HashedString : public STR_String
{
public:
- STR_HashedString() : STR_String(),m_Hashed(false) {}
- STR_HashedString(const char* str) : STR_String(str),m_Hashed(false) {}
- STR_HashedString(const STR_String& str) : STR_String(str),m_Hashed(false) {}
+ STR_HashedString() : STR_String(), m_Hashed(false) {}
+ STR_HashedString(const char *str) : STR_String(str), m_Hashed(false) {}
+ STR_HashedString(const STR_String &str) : STR_String(str), m_Hashed(false) {}
- inline dword hash(dword init=0) const
+ inline dword hash(dword init = 0) const
{
if (!m_Hashed)
{
- const char* str = *this;
+ const char *str = *this;
int length = this->Length();
- m_CachedHash = STR_gHash(str,length,init);
- m_Hashed=true;
+ m_CachedHash = STR_gHash(str, length, init);
+ m_Hashed = true;
}
return m_CachedHash;
}