From f46d63d35c61c9076a3c4ef9936bd88dbf8b8218 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 1 Nov 2013 16:44:44 +0700 Subject: ZVISION: Implement engine-wide method for selecting new audio ID. --- engines/zvision/zvision.cpp | 10 +++++++++- engines/zvision/zvision.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3