2.5
[blender.git] / source / blender / blenlib / intern / bpath.c
index 66eb63c8dfdecef971f64e870fe9a7fdb364f3a8..5c8eb5d2aa0ccf8ebc77fbf3a9477a0cc0e8a69a 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#include "BLI_bpath.h"
-#include "BKE_global.h"
-#include "BIF_screen.h" /* only for wait cursor */
+#include "MEM_guardedalloc.h"
+
 #include "DNA_ID.h" /* Library */
 #include "DNA_vfont_types.h"
 #include "DNA_image_types.h"
 #include "DNA_sound_types.h"
 #include "DNA_scene_types.h" /* to get the current frame */
 #include "DNA_sequence_types.h"
-#include <stdlib.h>
-#include <string.h>
+#include "DNA_text_types.h"
 
-#include "BKE_main.h" /* so we can access G.main->*.first */
-#include "BKE_image.h" /* so we can check the image's type */
+#include "BLI_blenlib.h"
+#include "BLI_bpath.h"
 
-#include "blendef.h"
+#include "BKE_global.h"
+#include "BKE_image.h" /* so we can check the image's type */
+#include "BKE_main.h" /* so we can access G.main->*.first */
+#include "BKE_sequence.h"
+#include "BKE_text.h" /* for writing to a textblock */
 #include "BKE_utildefines.h"
-#include "MEM_guardedalloc.h"
 
+//XXX #include "BIF_screen.h" /* only for wait cursor */
+//
 /* for sequence */
-#include "BSE_sequence.h"
-
-/* for writing to a textblock */
-#include "BKE_text.h" 
-#include "BLI_blenlib.h"
-#include "DNA_text_types.h"
+//XXX #include "BSE_sequence.h"
+//XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
+#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
 
 /* path/file handeling stuff */
 #ifndef WIN32
@@ -69,7 +69,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-
+#include <string.h>
 
 #define FILE_MAX                       240
 
@@ -130,9 +130,9 @@ void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_ex
        libpath = BLI_bpathIterator_getLib(bpi);
        
        if (libpath) { /* check the files location relative to its library path */
-               BLI_convertstringcode(path_expanded, libpath, G.scene->r.cfra);
+               BLI_convertstringcode(path_expanded, libpath);
        } else { /* local data, use the blend files path */
-               BLI_convertstringcode(path_expanded, G.sce, G.scene->r.cfra);
+               BLI_convertstringcode(path_expanded, G.sce);
        }
 }
 char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) {
@@ -218,7 +218,7 @@ static struct Sequence *seq_stepdata__internal(struct BPathIterator *bpi, int st
                if (bpi->seqdata.scene->ed) {
                        if (bpi->seqdata.seqar == NULL) {
                                /* allocate the sequencer array */
-                               build_seqar( &(((Editing *)bpi->seqdata.scene->ed)->seqbase), &bpi->seqdata.seqar, &bpi->seqdata.totseq);               
+                               seq_array(bpi->seqdata.scene->ed, &bpi->seqdata.seqar, &bpi->seqdata.totseq, 0);                
                                bpi->seqdata.seq = 0;
                        }
                        
@@ -254,7 +254,7 @@ static struct Sequence *seq_stepdata__internal(struct BPathIterator *bpi, int st
        return NULL;
 }
 
-void seq_getpath(struct BPathIterator *bpi, char *path) {
+static void seq_getpath(struct BPathIterator *bpi, char *path) {
        Sequence *seq = (Sequence *)bpi->data;
 
        
@@ -275,7 +275,7 @@ void seq_getpath(struct BPathIterator *bpi, char *path) {
        }
 }
 
-void seq_setpath(struct BPathIterator *bpi, char *path) {
+static void seq_setpath(struct BPathIterator *bpi, char *path) {
        Sequence *seq = (Sequence *)bpi->data;
        if (seq==NULL) return; 
        
@@ -456,13 +456,9 @@ void checkMissingFiles( char *txtname ) {
        
        /* be sure there is low chance of the path being too short */
        char filepath_expanded[FILE_MAXDIR*2]; 
-       char *libpath;
-       int files_missing = 0;
        
        BLI_bpathIterator_init(&bpi);
        while (!BLI_bpathIterator_isDone(&bpi)) {
-               libpath = BLI_bpathIterator_getLib(&bpi);
-               
                BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
                
                if (!BLI_exists(filepath_expanded)) {
@@ -473,7 +469,6 @@ void checkMissingFiles( char *txtname ) {
                                }
                        }
                        bpathToText(btxt, &bpi);
-                       files_missing = 1;
                }
                BLI_bpathIterator_step(&bpi);
        }
@@ -662,7 +657,7 @@ void findMissingFiles(char *str) {
        
        char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX];
        
-       waitcursor( 1 );
+       //XXX waitcursor( 1 );
        
        BLI_split_dirfile_basic(str, dirname, NULL);
        
@@ -673,9 +668,9 @@ void findMissingFiles(char *str) {
                libpath = BLI_bpathIterator_getLib(&bpi);
                
                /* Check if esc was pressed because searching files can be slow */
-               if (blender_test_break()) {
+               /*XXX if (blender_test_break()) {
                        break;
-               }
+               }*/
                
                if (libpath==NULL) {
                        
@@ -711,5 +706,5 @@ void findMissingFiles(char *str) {
        }
        BLI_bpathIterator_free(&bpi);
        
-       waitcursor( 0 );
+       //XXX waitcursor( 0 );
 }