version 1.8 | | version 1.9 |
---|
| | |
* Functions for managing the pig files. | | * Functions for managing the pig files. |
* | | * |
* $Log$ | | * $Log$ |
| | * Revision 1.9 2000/04/18 01:17:58 sekmu |
| | * Changed/fixed altsounds (mostly done) |
| | * |
* Revision 1.8 2000/02/07 07:27:04 donut | | * Revision 1.8 2000/02/07 07:27:04 donut |
* killed ifndef linux around some free(), it doesn't seem to crash anymore | | * killed ifndef linux around some free(), it doesn't seem to crash anymore |
* | | * |
| | |
#include "newmenu.h" | | #include "newmenu.h" |
#include "custom.h" | | #include "custom.h" |
| | |
//added 11/13/99 by Victor Rachels for alternate sounds | | |
#include "altsound.h" | | |
//end this section addition - VR | | |
| | |
int piggy_is_substitutable_bitmap( char * name, char * subst_name ); | | int piggy_is_substitutable_bitmap( char * name, char * subst_name ); |
| | |
//#define NO_DUMP_SOUNDS 1 //if set, dump bitmaps but not sounds | | //#define NO_DUMP_SOUNDS 1 //if set, dump bitmaps but not sounds |
| | |
} | | } |
| | |
for (i=0; i<N_sounds; i++ ) { | | for (i=0; i<N_sounds; i++ ) { |
//edited on 1/22/99 by Victor Rachels to complete alt soundfiles | | |
//added on 11/13/99 by Victor Rachels to add alt soundfiles | | |
if(use_alt_sounds && use_alt_sound(i)) | | |
{ | | |
char *altfname; | | |
altfname = load_alt_sound_info(i,&temp_sound); | | |
piggy_register_sound(&temp_sound,altfname,1); | | |
SoundOffset[Num_sound_files] = 0; | | |
sbytes += get_alt_sound_size(i); | | |
} | | |
else | | |
{ | | |
cfread( &sndh, sizeof(DiskSoundHeader), 1, Piggy_fp ); | | cfread( &sndh, sizeof(DiskSoundHeader), 1, Piggy_fp ); |
| | |
//size -= sizeof(DiskSoundHeader); | | //size -= sizeof(DiskSoundHeader); |
| | |
sbytes += sndh.length; | | sbytes += sndh.length; |
//mprintf(( 0, "%d bytes of sound\n", sbytes )); | | //mprintf(( 0, "%d bytes of sound\n", sbytes )); |
| | |
} // - VR - link to alt sound stuff | | |
} | | } |
| | |
SoundBits = malloc( sbytes + 16 ); | | SoundBits = malloc( sbytes + 16 ); |
| | |
for (i=0; i<Num_sound_files; i++ ) { | | for (i=0; i<Num_sound_files; i++ ) { |
digi_sound *snd = &GameSounds[i]; | | digi_sound *snd = &GameSounds[i]; |
| | |
//edited on 1/22/99 by Victor Rachels to complete alt soundfiles | | if ( SoundOffset[i] > 0 ) { |
//added on 11/13/99 by Victor Rachels to use alternate sounds | | |
if ( use_alt_sounds && use_alt_sound(i) ) | | |
{ | | |
snd->data = ptr; | | |
load_alt_sound(i,snd); | | |
ptr += get_alt_sound_size(i); | | |
sbytes += get_alt_sound_size(i); | | |
} | | |
else if ( SoundOffset[i] > 0 ) { | | |
//end this section addition - VR | | |
if ( piggy_is_needed(i) ) { | | if ( piggy_is_needed(i) ) { |
cfseek( Piggy_fp, SoundOffset[i], SEEK_SET ); | | cfseek( Piggy_fp, SoundOffset[i], SEEK_SET ); |
| | |
| | |
mprintf( (0, "\nDumping sounds..." )); | | mprintf( (0, "\nDumping sounds..." )); |
| | |
for (i=0; i < Num_sound_files; i++ ) | | for (i=0; i < Num_sound_files; i++ ) |
if(!use_alt_sounds || !use_alt_sound(i)) { | | { |
digi_sound *snd; | | digi_sound *snd; |
| | |
snd = &GameSounds[i]; | | snd = &GameSounds[i]; |