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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-08 02:40:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-08 02:40:03 +0400
commit26c08392208638f5a83871808394c729577538b8 (patch)
tree397d82d798ac55f646c4d3434e96afe40f6af7a1
parent67ae5e81588f04174dcddeff2ad10cea0a69c9d6 (diff)
disable cycles when building without python, also use const for function args in more places.
-rw-r--r--CMakeLists.txt4
-rw-r--r--source/blender/blenkernel/BKE_image.h2
-rw-r--r--source/blender/blenkernel/intern/image.c4
-rw-r--r--source/blender/render/intern/include/zbuf.h12
-rw-r--r--source/blender/render/intern/source/zbuf.c29
5 files changed, 33 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e91ec18caee..6efef21afc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -416,6 +416,10 @@ if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
endif()
+if(NOT WITH_PYTHON)
+ set(WITH_CYCLES OFF)
+endif()
+
# enable boost for cycles, booleans, audaspace or i18n
# otherwise if the user disabled
if(NOT WITH_BOOST)
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index eefaac07b12..7b5abbba7f8 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -161,7 +161,7 @@ struct Image *BKE_image_load(struct Main *bmain, const char *filepath);
struct Image *BKE_image_load_exists(const char *filepath);
/* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_image_add_generated(struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4]);
+struct Image *BKE_image_add_generated(struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4]);
/* adds image from imbuf, owns imbuf */
struct Image *BKE_image_add_from_imbuf(struct ImBuf *ibuf);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 63d0df76a6f..71289457ae9 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -653,7 +653,7 @@ Image *BKE_image_load_exists(const char *filepath)
}
static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type,
- float color[4], ColorManagedColorspaceSettings *colorspace_settings)
+ const float color[4], ColorManagedColorspaceSettings *colorspace_settings)
{
ImBuf *ibuf;
unsigned char *rect = NULL;
@@ -710,7 +710,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
}
/* adds new image block, creates ImBuf and initializes color */
-Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4])
+Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4])
{
/* on save, type is changed to FILE in editsima.c */
Image *ima = image_alloc(bmain, name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h
index ca9897b652c..ec30c3241ab 100644
--- a/source/blender/render/intern/include/zbuf.h
+++ b/source/blender/render/intern/include/zbuf.h
@@ -120,8 +120,9 @@ typedef struct ZSpan {
} ZSpan;
/* exported to shadbuf.c */
-void zbufclip4(struct ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, float *f4,
- int c1, int c2, int c3, int c4);
+void zbufclip4(struct ZSpan *zspan, int obi, int zvlnr,
+ const float f1[4], const float f2[4], const float f3[4], const float f4[4],
+ const int c1, const int c2, const int c3, const int c4);
void zbuf_free_span(struct ZSpan *zspan);
void freepsA(struct ListBase *lb);
@@ -130,10 +131,13 @@ void zspan_scanconvert(struct ZSpan *zpan, void *handle, float *v1, float *v2, f
void (*func)(void *, int, int, float, float) );
/* exported to edge render... */
-void zbufclip(struct ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3);
+void zbufclip(struct ZSpan *zspan, int obi, int zvlnr,
+ const float f1[4], const float f2[4], const float f3[4],
+ const int c1, const int c2, const int c3);
void zbuf_alloc_span(struct ZSpan *zspan, int rectx, int recty, float clipcrop);
void zbufclipwire(struct ZSpan *zspan, int obi, int zvlnr, int ec,
- float *ho1, float *ho2, float *ho3, float *ho4, int c1, int c2, int c3, int c4);
+ const float ho1[4], const float ho2[4], const float ho3[4], const float ho4[4],
+ const int c1, const int c2, const int c3, const int c4);
/* exported to shadeinput.c */
void zbuf_make_winmat(Render *re, float winmat[4][4]);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 664a29df523..d65db9d47f8 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -121,7 +121,7 @@ static void zbuf_init_span(ZSpan *zspan)
zspan->minp1= zspan->maxp1= zspan->minp2= zspan->maxp2= NULL;
}
-static void zbuf_add_to_span(ZSpan *zspan, const float *v1, const float *v2)
+static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
{
const float *minv, *maxv;
float *span;
@@ -909,7 +909,9 @@ void hoco_to_zco(ZSpan *zspan, float zco[3], const float hoco[4])
zco[2]= 0x7FFFFFFF *(hoco[2]*div);
}
-void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *ho2, float *ho3, float *ho4, int c1, int c2, int c3, int c4)
+void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec,
+ const float ho1[4], const float ho2[4], const float ho3[4], const float ho4[4],
+ int c1, int c2, int c3, int c4)
{
float vez[20];
int and, or;
@@ -1845,7 +1847,9 @@ void zbuf_make_winmat(Render *re, float winmat[4][4])
/* do zbuffering and clip, f1 f2 f3 are hocos, c1 c2 c3 are clipping flags */
-void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3)
+void zbufclip(ZSpan *zspan, int obi, int zvlnr,
+ const float f1[4], const float f2[4], const float f3[4],
+ const int c1, const int c2, const int c3)
{
float *vlzp[32][3], lambda[3][2];
float vez[400], *trias[40];
@@ -1856,6 +1860,7 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
else { /* clipping */
int arg, v, b, clipflag[3], b1, b2, b3, c4, clve=3, clvlo, clvl=1;
+ float *fp;
vez[0]= f1[0]; vez[1]= f1[1]; vez[2]= f1[2]; vez[3]= f1[3];
vez[4]= f2[0]; vez[5]= f2[1]; vez[6]= f2[2]; vez[7]= f2[3];
@@ -1936,16 +1941,16 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
}
- /* warning, this should never happen! */
- if (clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n", clve, clvl);
+ /* warning, clip overflow, this should never happen! */
+ BLI_assert(!(clve > 38 || clvl > 31));
/* perspective division */
- f1=vez;
- for (c1=0;c1<clve;c1++) {
- hoco_to_zco(zspan, f1, f1);
- f1+=4;
+ fp = vez;
+ for (b = 0; b < clve; b++) {
+ hoco_to_zco(zspan, fp, fp);
+ fp += 4;
}
- for (b=1;b<clvl;b++) {
+ for (b = 1; b < clvl; b++) {
if (vlzp[b][0]) {
zspan->zbuffunc(zspan, obi, zvlnr, vlzp[b][0], vlzp[b][1], vlzp[b][2], NULL);
}
@@ -1961,7 +1966,9 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
zspan->zbuffunc(zspan, obi, zvlnr, vez, vez+4, vez+8, NULL);
}
-void zbufclip4(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, float *f4, int c1, int c2, int c3, int c4)
+void zbufclip4(ZSpan *zspan, int obi, int zvlnr,
+ const float f1[4], const float f2[4], const float f3[4], const float f4[4],
+ const int c1, const int c2, const int c3, const int c4)
{
float vez[16];