aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/sound_nebular.h
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-05 12:16:24 -0500
committerPaul Gilbert2015-03-05 12:16:24 -0500
commit3fae9f17dacaa4f8253c2f6b47adb9845cdb52b0 (patch)
tree44b593f739f45450ceef60aa89ddf456a136abee /engines/mads/nebular/sound_nebular.h
parentf501e91ed1490fde5227015dc02fbe6c0cee2b5f (diff)
downloadscummvm-rg350-3fae9f17dacaa4f8253c2f6b47adb9845cdb52b0.tar.gz
scummvm-rg350-3fae9f17dacaa4f8253c2f6b47adb9845cdb52b0.tar.bz2
scummvm-rg350-3fae9f17dacaa4f8253c2f6b47adb9845cdb52b0.zip
MADS: Show a warning if sound code reads beyond end of sound data blocks
Diffstat (limited to 'engines/mads/nebular/sound_nebular.h')
-rw-r--r--engines/mads/nebular/sound_nebular.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h
index ccfd40ad52..cfacb211a4 100644
--- a/engines/mads/nebular/sound_nebular.h
+++ b/engines/mads/nebular/sound_nebular.h
@@ -37,11 +37,15 @@ class SoundManager;
namespace Nebular {
+class ASound;
+
/**
* Represents the data for a channel on the Adlib
*/
class AdlibChannel {
public:
+ ASound *_owner;
+
int _activeCount;
int _field1;
int _field2;
@@ -61,6 +65,7 @@ public:
byte *_pSrc;
byte *_ptr3;
byte *_ptr4;
+ byte *_ptrEnd;
int _field17;
int _field19;
byte *_soundData;
@@ -128,15 +133,17 @@ struct RegisterValue {
#define ADLIB_CHANNEL_MIDWAY 5
#define CALLBACKS_PER_SECOND 60
+struct CachedDataEntry {
+ int _offset;
+ byte *_data;
+ byte *_dataEnd;
+};
+
/**
* Base class for the sound player resource files
*/
class ASound : public Audio::AudioStream {
private:
- struct CachedDataEntry {
- int _offset;
- byte *_data;
- };
Common::List<CachedDataEntry> _dataCache;
uint16 _randomSeed;
@@ -350,6 +357,11 @@ public:
*/
int getFrameCounter() { return _frameCounter; }
+ /**
+ * Return the cached data block record for previously loaded sound data
+ */
+ CachedDataEntry &getCachedData(byte *pData);
+
// AudioStream interface
/**
* Main buffer read