[Scummvm-cvs-logs] CVS: scummvm/bs2 anims.cpp,1.16,1.17
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Sun Sep 21 23:37:04 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummex bomp.cpp,NONE,1.1 bomp.h,NONE,1.1 codec37.cpp,NONE,1.1 codec37.h,NONE,1.1 codec47.cpp,NONE,1.1 codec47.h,NONE,1.1 Makefile,1.5,1.6 image.cpp,1.5,1.6 image.h,1.4,1.5 resource.h,1.5,1.6 scummex.cpp,1.12,1.13 scummex.h,1.5,1.6 wxwindows.cpp,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.19,1.20 d_sound.cpp,1.56,1.57 d_sound.h,1.13,1.14 driver96.h,1.37,1.38
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv9374
Modified Files:
anims.cpp
Log Message:
Cleaned up the sound code enough to add cutscene voice-overs. I haven't had
the time to do much testing yet, but it seems to work for me.
Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/anims.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- anims.cpp 19 Sep 2003 06:41:40 -0000 1.16
+++ anims.cpp 22 Sep 2003 06:36:37 -0000 1.17
@@ -479,7 +479,8 @@
uint16 startFrame;
uint16 endFrame;
mem *text_mem;
- mem *speech_mem;
+ uint32 speechBufferSize;
+ uint16 *speech_mem;
} _sequenceTextInfo;
// keeps count of number of text lines to disaply during the sequence
@@ -513,10 +514,9 @@
uint32 local_text;
uint32 text_res;
uint8 *text;
- int16 wavId; // ie. offical text number (actor text number)
+ uint32 wavId; // ie. offical text number (actor text number)
uint8 speechRunning;
char speechFile[256];
- int32 wavSize;
// for each sequence text line that's been logged
for (line = 0; line < sequenceTextLines; line++) {
@@ -568,45 +568,10 @@
else
strcpy(speechFile, "speech.clu");
- wavSize = g_sound->GetCompSpeechSize(speechFile, wavId);
- if (wavSize) {
- // if we've got the wav
- // allocate memory for speech buffer
- // last param is an optional id for type of
- // mem block
-
- sequence_text_list[line].speech_mem = Twalloc(wavSize, MEM_locked, UID_temp);
-
- // if mem allocated ok (should be fine, but
- // worth checking)
-
- if (sequence_text_list[line].speech_mem) {
- // Load speech & decompress to our
- // buffer
-
- if (g_sound->PreFetchCompSpeech(speechFile, wavId, sequence_text_list[line].speech_mem->ad) == RD_OK) {
- // ok, we've got speech!
-
- // now float this buffer so we
- // can make space for the next
- // text sprites and/or speech
- // samples
-
- Float_mem(sequence_text_list[line].speech_mem);
- speechRunning = 1;
- } else {
- // whoops, sample didn't load
- // & decompress for some
- // reason...
-
- // may as well free up speech
- // buffer now, rather than in
- // ClearSequenceSpeech();
-
- Free_mem(sequence_text_list[line].speech_mem);
- sequence_text_list[line].speech_mem = NULL;
- }
- }
+ sequence_text_list[line].speechBufferSize = g_sound->PreFetchCompSpeech((char *) speechFile, wavId, &sequence_text_list[line].speech_mem);
+ if (sequence_text_list[line].speechBufferSize) {
+ // ok, we've got speech!
+ speechRunning = 1;
}
}
@@ -664,12 +629,11 @@
// if we've loaded a speech sample for this line...
if (sequence_text_list[line].speech_mem) {
- Lock_mem(sequence_text_list[line].speech_mem);
-
// for drivers: set up pointer to decompressed wav in
// memory
- sequenceText[line]->speech = (_wavHeader *) sequence_text_list[line].speech_mem->ad;
+ sequenceText[line]->speechBufferSize = sequence_text_list[line].speechBufferSize;
+ sequenceText[line]->speech = sequence_text_list[line].speech_mem;
}
}
}
@@ -689,7 +653,7 @@
// free up the mem block containing this speech sample
if (sequence_text_list[line].speech_mem)
- Free_mem(sequence_text_list[line].speech_mem);
+ free(sequence_text_list[line].speech_mem);
}
// IMPORTANT! Reset the line count ready for the next sequence!
- Previous message: [Scummvm-cvs-logs] CVS: scummex bomp.cpp,NONE,1.1 bomp.h,NONE,1.1 codec37.cpp,NONE,1.1 codec37.h,NONE,1.1 codec47.cpp,NONE,1.1 codec47.h,NONE,1.1 Makefile,1.5,1.6 image.cpp,1.5,1.6 image.h,1.4,1.5 resource.h,1.5,1.6 scummex.cpp,1.12,1.13 scummex.h,1.5,1.6 wxwindows.cpp,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.19,1.20 d_sound.cpp,1.56,1.57 d_sound.h,1.13,1.14 driver96.h,1.37,1.38
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list