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:
authorJoerg Mueller <nexyon@gmail.com>2009-08-10 01:16:39 +0400
committerJoerg Mueller <nexyon@gmail.com>2009-08-10 01:16:39 +0400
commit6c5c58e05799f2b593cd81fcff57e6ef72ad57fb (patch)
tree8add929ef94d03fc69aecce6ef2baf283505782f /source/blender/blenkernel/intern/packedFile.c
parentc1ca2ab5dceb8d5355215a3c7a80b171f394e487 (diff)
2.5: Sound branch merge!
See mailing list for additional information.
Diffstat (limited to 'source/blender/blenkernel/intern/packedFile.c')
-rw-r--r--source/blender/blenkernel/intern/packedFile.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 590189fbd5d..8c77ed92aa1 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -123,7 +123,7 @@ int countPackedFiles(Main *bmain)
{
Image *ima;
VFont *vf;
- bSample *sample;
+ bSound *sound;
int count = 0;
// let's check if there are packed files...
@@ -135,10 +135,9 @@ int countPackedFiles(Main *bmain)
if(vf->packedfile)
count++;
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile)
- count++;
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile)
+ count++;
return count;
}
@@ -208,8 +207,8 @@ void packAll(Main *bmain, ReportList *reports)
{
Image *ima;
VFont *vf;
- bSample *sample;
-
+ bSound *sound;
+
for(ima=bmain->image.first; ima; ima=ima->id.next)
if(ima->packedfile == NULL)
ima->packedfile = newPackedFile(reports, ima->name);
@@ -218,10 +217,9 @@ void packAll(Main *bmain, ReportList *reports)
if(vf->packedfile == NULL)
vf->packedfile = newPackedFile(reports, vf->name);
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile == NULL)
- sound_set_packedfile(sample, newPackedFile(reports, sample->name));
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile == NULL)
+ sound->packedfile = newPackedFile(reports, sound->name);
}
@@ -456,28 +454,26 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
return (ret_value);
}
-int unpackSample(ReportList *reports, bSample *sample, int how)
+int unpackSound(ReportList *reports, bSound *sound, int how)
{
char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
char *newname;
int ret_value = RET_ERROR;
- PackedFile *pf;
-
- if (sample != NULL) {
- strcpy(localname, sample->name);
+
+ if (sound != NULL) {
+ strcpy(localname, sound->name);
BLI_splitdirstring(localname, fi);
- sprintf(localname, "//samples/%s", fi);
-
- newname = unpackFile(reports, sample->name, localname, sample->packedfile, how);
+ sprintf(localname, "//sounds/%s", fi);
+
+ newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
if (newname != NULL) {
- strcpy(sample->name, newname);
+ strcpy(sound->name, newname);
MEM_freeN(newname);
- pf = sample->packedfile;
- // because samples and sounds can point to the
- // same packedfile we have to check them all
- sound_set_packedfile(sample, NULL);
- freePackedFile(pf);
+ freePackedFile(sound->packedfile);
+ sound->packedfile = 0;
+
+ sound_load(sound);
ret_value = RET_OK;
}
@@ -515,7 +511,7 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
{
Image *ima;
VFont *vf;
- bSample *sample;
+ bSound *sound;
for(ima=bmain->image.first; ima; ima=ima->id.next)
if(ima->packedfile)
@@ -525,9 +521,8 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
if(vf->packedfile)
unpackVFont(reports, vf, how);
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile)
- unpackSample(reports, sample, how);
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile)
+ unpackSound(reports, sound, how);
}