[Scummvm-cvs-logs] CVS: scummvm/saga reinherit.h,1.9,1.10 saga.cpp,1.11,1.12 sndres.cpp,1.6,1.7 sndres.h,1.6,1.7 sound.cpp,1.2,1.3 sound.h,1.1,1.2
Eugene Sandulenko
sev at users.sourceforge.net
Wed Apr 28 18:25:06 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/saga sound.h,NONE,1.1 actor.cpp,1.4,1.5 reinherit.h,1.8,1.9 saga.cpp,1.10,1.11 saga.h,1.6,1.7 sceneproc.cpp,1.2,1.3 sndres.cpp,1.5,1.6 sndres.h,1.5,1.6 sound.cpp,1.1,1.2
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga music.cpp,NONE,1.1 module.mk,1.9,1.10 sound.h,1.2,1.3 sysmusic.cpp,1.1,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4539
Modified Files:
reinherit.h saga.cpp sndres.cpp sndres.h sound.cpp sound.h
Log Message:
Voices are played
Index: reinherit.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/reinherit.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- reinherit.h 28 Apr 2004 23:54:40 -0000 1.9
+++ reinherit.h 29 Apr 2004 01:24:18 -0000 1.10
@@ -103,19 +103,6 @@
void *impl_src;
};
-struct R_SOUNDBUFFER {
- const uchar *res_data;
- size_t res_len;
-
- long s_freq;
- int s_samplebits;
- int s_stereo;
- int s_signed;
-
- const uchar *s_buf;
- size_t s_buf_len;
-};
-
#define R_RGB_RED 0x00FF0000UL
#define R_RGB_GREEN 0x0000FF00UL
#define R_RGB_BLUE 0x000000FFUL
Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- saga.cpp 28 Apr 2004 23:54:40 -0000 1.11
+++ saga.cpp 29 Apr 2004 01:24:18 -0000 1.12
@@ -253,7 +253,7 @@
}
/* Initialize system specific sound */
- _sound = new Sound(MainData.sound_enabled);
+ _sound = new Sound(this, _mixer, MainData.sound_enabled);
if (!MainData.sound_enabled) {
R_printf(R_STDOUT, "Sound disabled.\n");
}
Index: sndres.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sndres.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sndres.cpp 28 Apr 2004 23:54:40 -0000 1.6
+++ sndres.cpp 29 Apr 2004 01:24:18 -0000 1.7
@@ -75,6 +75,8 @@
R_SOUNDBUFFER snd_buffer;
int result;
+ debug(0, "SndRes::playVoice(%ld)", voice_rn);
+
result = load(_voice_ctxt, voice_rn, &snd_buffer);
if (result != R_SUCCESS) {
return R_FAILURE;
@@ -135,7 +137,7 @@
return R_SUCCESS;
}
-int SndRes::loadVocSound(const uchar *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_buf_i) {
+int SndRes::loadVocSound(byte *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_buf_i) {
R_VOC_HEADER_BLOCK voc_hb;
R_VOC_GENBLOCK voc_gb;
R_VOC_BLOCK1 voc_b1;
Index: sndres.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sndres.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sndres.h 28 Apr 2004 23:54:40 -0000 1.6
+++ sndres.h 29 Apr 2004 01:24:18 -0000 1.7
@@ -33,6 +33,7 @@
#include "rscfile_mod.h"
#include "game_mod.h"
+#include "sound.h"
namespace Saga {
@@ -78,7 +79,7 @@
private:
int load(R_RSCFILE_CONTEXT *snd_ctxt, ulong snd_rn, R_SOUNDBUFFER *snd_buf_i);
- int loadVocSound(const uchar *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_buf_i);
+ int loadVocSound(byte *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_buf_i);
int _init;
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sound.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sound.cpp 28 Apr 2004 23:54:40 -0000 1.2
+++ sound.cpp 29 Apr 2004 01:24:18 -0000 1.3
@@ -31,13 +31,16 @@
#include "sound.h"
#include "game_mod.h"
+#include "sound/mixer.h"
+
namespace Saga {
/*
* Begin module component
\*--------------------------------------------------------------------------*/
-Sound::Sound(int enabled) {
+Sound::Sound(SagaEngine *vm, SoundMixer *mixer, int enabled) :
+ _vm(vm), _mixer(mixer) {
int result;
/* Load sound module resource file contexts */
@@ -52,7 +55,7 @@
}
/* Grab sound resource information for the current game */
- //GAME_GetSoundInfo(&SoundModule.snd_info);
+ GAME_GetSoundInfo(&_snd_info);
_soundInitialized = 1;
return;
@@ -112,12 +115,21 @@
}
int Sound::playVoice(R_SOUNDBUFFER *buf) {
- (void)buf;
+ byte flags;
+ int game_id = GAME_GetGame();
if (!_soundInitialized) {
return R_FAILURE;
}
+ if((game_id == R_GAME_ITE_DISK) || (game_id == R_GAME_ITE_DEMO)) {
+ flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE;
+ } else {
+ flags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS |
+ SoundMixer::FLAG_LITTLE_ENDIAN;
+ }
+ _mixer->playRaw(&_voiceHandle, buf->res_data, buf->res_len, buf->s_freq, flags);
+
return R_SUCCESS;
}
@@ -126,6 +138,8 @@
return R_FAILURE;
}
+ _mixer->pauseHandle(_voiceHandle, true);
+
return R_SUCCESS;
}
@@ -134,6 +148,8 @@
return R_FAILURE;
}
+ _mixer->pauseHandle(_voiceHandle, false);
+
return R_SUCCESS;
}
@@ -142,6 +158,8 @@
return R_FAILURE;
}
+ _mixer->stopHandle(_voiceHandle);
+
return R_SUCCESS;
}
Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sound.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sound.h 28 Apr 2004 23:54:40 -0000 1.1
+++ sound.h 29 Apr 2004 01:24:18 -0000 1.2
@@ -32,13 +32,29 @@
#define SAGA_SOUND_H_
#include "rscfile_mod.h"
+#include "game_mod.h"
+#include "sound/mixer.h"
namespace Saga {
+struct R_SOUNDBUFFER {
+ byte *res_data;
+ uint32 res_len;
+
+ uint s_freq;
+ int s_samplebits;
+ int s_stereo;
+ int s_signed;
+
+ const uchar *s_buf;
+ size_t s_buf_len;
+};
+
+
class Sound {
public:
- Sound(int enabled);
+ Sound(SagaEngine *vm, SoundMixer *mixer, int enabled);
~Sound(void);
int play(int sound_rn, int channel);
@@ -55,9 +71,18 @@
int _soundInitialized;
+ R_GAME_SOUNDINFO _snd_info;
+
R_RSCFILE_CONTEXT *_soundContext;
R_RSCFILE_CONTEXT *_voiceContext;
+ SagaEngine *_vm;
+ SoundMixer *_mixer;
+
+ PlayingSoundHandle _effectHandle;
+ PlayingSoundHandle _voiceHandle;
+ PlayingSoundHandle _musictHandle;
+
};
} // End of namespace Saga
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/saga sound.h,NONE,1.1 actor.cpp,1.4,1.5 reinherit.h,1.8,1.9 saga.cpp,1.10,1.11 saga.h,1.6,1.7 sceneproc.cpp,1.2,1.3 sndres.cpp,1.5,1.6 sndres.h,1.5,1.6 sound.cpp,1.1,1.2
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga music.cpp,NONE,1.1 module.mk,1.9,1.10 sound.h,1.2,1.3 sysmusic.cpp,1.1,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list