Revision: 59006
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59006
Author:   campbellbarton
Date:     2013-08-07 22:40:03 +0000 (Wed, 07 Aug 2013)
Log Message:
-----------
disable cycles when building without python, also use const for function args 
in more places.

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/source/blender/blenkernel/BKE_image.h
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/render/intern/include/zbuf.h
    trunk/blender/source/blender/render/intern/source/zbuf.c

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt        2013-08-07 21:56:34 UTC (rev 59005)
+++ trunk/blender/CMakeLists.txt        2013-08-07 22:40:03 UTC (rev 59006)
@@ -416,6 +416,10 @@
        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)

Modified: trunk/blender/source/blender/blenkernel/BKE_image.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_image.h 2013-08-07 21:56:34 UTC 
(rev 59005)
+++ trunk/blender/source/blender/blenkernel/BKE_image.h 2013-08-07 22:40:03 UTC 
(rev 59006)
@@ -161,7 +161,7 @@
 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);
 

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c      2013-08-07 
21:56:34 UTC (rev 59005)
+++ trunk/blender/source/blender/blenkernel/intern/image.c      2013-08-07 
22:40:03 UTC (rev 59006)
@@ -653,7 +653,7 @@
 }
 
 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 @@
 }
 
 /* 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);

Modified: trunk/blender/source/blender/render/intern/include/zbuf.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/zbuf.h   2013-08-07 
21:56:34 UTC (rev 59005)
+++ trunk/blender/source/blender/render/intern/include/zbuf.h   2013-08-07 
22:40:03 UTC (rev 59006)
@@ -120,8 +120,9 @@
 } 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 (*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]);

Modified: trunk/blender/source/blender/render/intern/source/zbuf.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/zbuf.c    2013-08-07 
21:56:34 UTC (rev 59005)
+++ trunk/blender/source/blender/render/intern/source/zbuf.c    2013-08-07 
22:40:03 UTC (rev 59006)
@@ -121,7 +121,7 @@
        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 @@
        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 @@
 
 /* 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 @@
                }
                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 @@
                                }
                        }
 
-                       /* 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 @@
        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];
        

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to