Revision: 17435
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17435
Author:   campbellbarton
Date:     2008-11-12 23:35:58 +0100 (Wed, 12 Nov 2008)

Log Message:
-----------
2 utility functions added for projection painting.
* BLI_linklist_index() - to get an items index in a  LinkList
* BLI_memarena_use_malloc() - BLI_memarena_use_calloc alredy existed but there 
was no way to switch back to malloc.

also added texnodes to cmake

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_linklist.h
    trunk/blender/source/blender/blenlib/BLI_memarena.h
    trunk/blender/source/blender/blenlib/intern/BLI_linklist.c
    trunk/blender/source/blender/blenlib/intern/BLI_memarena.c
    trunk/blender/source/blender/nodes/CMakeLists.txt

Modified: trunk/blender/source/blender/blenlib/BLI_linklist.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_linklist.h 2008-11-12 22:03:11 UTC 
(rev 17434)
+++ trunk/blender/source/blender/blenlib/BLI_linklist.h 2008-11-12 22:35:58 UTC 
(rev 17435)
@@ -45,6 +45,7 @@
 } LinkNode;
 
 int            BLI_linklist_length             (struct LinkNode *list);
+int            BLI_linklist_index              (struct LinkNode *list, void 
*ptr);
 
 void   BLI_linklist_reverse    (struct LinkNode **listp);
 

Modified: trunk/blender/source/blender/blenlib/BLI_memarena.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_memarena.h 2008-11-12 22:03:11 UTC 
(rev 17434)
+++ trunk/blender/source/blender/blenlib/BLI_memarena.h 2008-11-12 22:35:58 UTC 
(rev 17435)
@@ -50,6 +50,7 @@
 struct MemArena*       BLI_memarena_new        (int bufsize);
 void                           BLI_memarena_free       (struct MemArena *ma);
 
+void                           BLI_memarena_use_malloc (struct MemArena *ma);
 void                           BLI_memarena_use_calloc (struct MemArena *ma);
 
 void*                          BLI_memarena_alloc      (struct MemArena *ma, 
int size);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_linklist.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_linklist.c  2008-11-12 
22:03:11 UTC (rev 17434)
+++ trunk/blender/source/blender/blenlib/intern/BLI_linklist.c  2008-11-12 
22:35:58 UTC (rev 17435)
@@ -50,6 +50,18 @@
        }
 }
 
+int BLI_linklist_index(struct LinkNode *list, void *ptr)
+{
+       int index;
+       
+       for (index = 0; list; list= list->next, index++) {
+               if (list->link == ptr)
+                       return index;
+       }
+       
+       return -1;
+}
+
 void BLI_linklist_reverse(LinkNode **listp) {
        LinkNode *rhead= NULL, *cur= *listp;
        

Modified: trunk/blender/source/blender/blenlib/intern/BLI_memarena.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_memarena.c  2008-11-12 
22:03:11 UTC (rev 17434)
+++ trunk/blender/source/blender/blenlib/intern/BLI_memarena.c  2008-11-12 
22:35:58 UTC (rev 17435)
@@ -60,6 +60,10 @@
        ma->use_calloc= 1;
 }
 
+void BLI_memarena_use_malloc(MemArena *ma) {
+       ma->use_calloc= 0;
+}
+
 void BLI_memarena_free(MemArena *ma) {
        BLI_linklist_free(ma->bufs, (void(*)(void*)) MEM_freeN);
        MEM_freeN(ma);

Modified: trunk/blender/source/blender/nodes/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/nodes/CMakeLists.txt   2008-11-12 22:03:11 UTC 
(rev 17434)
+++ trunk/blender/source/blender/nodes/CMakeLists.txt   2008-11-12 22:35:58 UTC 
(rev 17435)
@@ -23,7 +23,7 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c)
+FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c 
intern/TEX_nodes/*.c)
 
 SET(INC 
   . ../../../intern/guardedalloc ../include ../blenlib ../makesdna


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

Reply via email to