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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-09 00:08:19 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-09 00:08:19 +0400
commitc8b4cf92067ffeb625aa39003baf5d8f7c3f0025 (patch)
treec6c50dbc3d90a65fca6c1ca56a93e4a57cf7e154 /source/blender/blenkernel/intern/customdata.c
parente93db433a086a3e739c0f4026cd500f0b595b0f1 (diff)
parentd76a6f5231c015c35123d22e1f5c3ffcdfbf9bbd (diff)
2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD Notes: * Game and sequencer RNA, and sequencer header are now out of date a bit after changes in trunk. * I didn't know how to port these bugfixes, most likely they are not needed anymore. * Fix "duplicate strip" always increase the user count for ipo. * IPO pinning on sequencer strips was lost during Undo.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 8c1065c1d84..705d0b66d7f 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -33,7 +33,7 @@
*/
#include "BKE_customdata.h"
-
+#include "BKE_utildefines.h" // CLAMP
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
@@ -573,6 +573,14 @@ static void layerInterp_mloopcol(void **sources, float *weights,
col.b += src->b * weight;
}
}
+
+ /* Subdivide smooth or fractal can cause problems without clamping
+ * although weights should also not cause this situation */
+ CLAMP(col.a, 0.0f, 255.0f);
+ CLAMP(col.r, 0.0f, 255.0f);
+ CLAMP(col.g, 0.0f, 255.0f);
+ CLAMP(col.b, 0.0f, 255.0f);
+
mc->a = (int)col.a;
mc->r = (int)col.r;
mc->g = (int)col.g;
@@ -648,6 +656,14 @@ static void layerInterp_mcol(void **sources, float *weights,
}
for(j = 0; j < 4; ++j) {
+
+ /* Subdivide smooth or fractal can cause problems without clamping
+ * although weights should also not cause this situation */
+ CLAMP(col[j].a, 0.0f, 255.0f);
+ CLAMP(col[j].r, 0.0f, 255.0f);
+ CLAMP(col[j].g, 0.0f, 255.0f);
+ CLAMP(col[j].b, 0.0f, 255.0f);
+
mc[j].a = (int)col[j].a;
mc[j].r = (int)col[j].r;
mc[j].g = (int)col[j].g;
@@ -783,7 +799,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
number++;
if(layer->flag & CD_FLAG_NOCOPY) continue;
- else if(!(mask & (1 << type))) continue;
+ else if(!((int)mask & (int)(1 << (int)type))) continue;
else if(number < CustomData_number_of_layers(dest, type)) continue;
if((alloctype == CD_ASSIGN) && (layer->flag & CD_FLAG_NOFREE))
@@ -1301,7 +1317,7 @@ void CustomData_set_only_copy(const struct CustomData *data,
int i;
for(i = 0; i < data->totlayer; ++i)
- if(!(mask & (1 << data->layers[i].type)))
+ if(!((int)mask & (int)(1 << (int)data->layers[i].type)))
data->layers[i].flag |= CD_FLAG_NOCOPY;
}