aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2013-11-01 16:44:44 +0700
committerMarisa-Chan2013-11-01 16:44:44 +0700
commitf46d63d35c61c9076a3c4ef9936bd88dbf8b8218 (patch)
treee214348953708b90b1ad82ce0fca497b43b503aa
parentd3ef75dac9a1ac9f091ccc75bf1bc51647a8ba02 (diff)
downloadscummvm-rg350-f46d63d35c61c9076a3c4ef9936bd88dbf8b8218.tar.gz
scummvm-rg350-f46d63d35c61c9076a3c4ef9936bd88dbf8b8218.tar.bz2
scummvm-rg350-f46d63d35c61c9076a3c4ef9936bd88dbf8b8218.zip
ZVISION: Implement engine-wide method for selecting new audio ID.
-rw-r--r--engines/zvision/zvision.cpp10
-rw-r--r--engines/zvision/zvision.h5
2 files changed, 14 insertions, 1 deletions
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 8be85d39d4..9a93259ff4 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -61,7 +61,8 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
_renderManager(nullptr),
_saveManager(nullptr),
_stringManager(nullptr),
- _cursorManager(nullptr) {
+ _cursorManager(nullptr),
+ _aud_id(0) {
debug(1, "ZVision::ZVision");
}
@@ -182,4 +183,11 @@ Common::String ZVision::generateAutoSaveFileName() {
return Common::String::format("%s.auto", _targetName.c_str());
}
+int ZVision::getAudioId() {
+ _aud_id++;
+ if (_aud_id < 0)
+ _aud_id = 0;
+ return _aud_id;
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 10711b1605..e7709283ae 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -101,6 +101,9 @@ private:
// Clock
Clock _clock;
+ // Audio ID
+ int _aud_id;
+
// To prevent allocation every time we process events
Common::Event _event;
@@ -145,6 +148,8 @@ public:
*/
void playVideo(Video::VideoDecoder &videoDecoder, const Common::Rect &destRect = Common::Rect(0, 0, 0, 0), bool skippable = true);
+ int getAudioId();
+
Common::String generateSaveFileName(uint slot);
Common::String generateAutoSaveFileName();