- Revised abstract AudioCDManager.
- Removed AudioCDManager Singleton, and changed code for using AudioCDManager in OSystem. - Added initialization code for new AudioCDManager in BaseBackend and OSystem_SDL. svn-id: r49548
This commit is contained in:
parent
4177a1e16d
commit
e991cd8c53
36 changed files with 116 additions and 495 deletions
|
@ -27,7 +27,6 @@
|
|||
#include "common/util.h"
|
||||
#include "common/events.h"
|
||||
#include "graphics/cursorman.h"
|
||||
#include "sound/audiocd.h"
|
||||
|
||||
#include "made/made.h"
|
||||
#include "made/resource.h"
|
||||
|
@ -595,9 +594,9 @@ int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) {
|
|||
}
|
||||
|
||||
int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
|
||||
AudioCD.play(argv[0] - 1, 1, 0, 0);
|
||||
g_system->getAudioCD()->play(argv[0] - 1, 1, 0, 0);
|
||||
_vm->_cdTimeStart = _vm->_system->getMillis();
|
||||
if (AudioCD.isPlaying()) {
|
||||
if (g_system->getAudioCD()->isPlaying()) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -605,8 +604,8 @@ int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
|
|||
}
|
||||
|
||||
int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
|
||||
if (AudioCD.isPlaying()) {
|
||||
AudioCD.stop();
|
||||
if (g_system->getAudioCD()->isPlaying()) {
|
||||
g_system->getAudioCD()->stop();
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -614,11 +613,11 @@ int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
|
|||
}
|
||||
|
||||
int16 ScriptFunctions::sfGetCdStatus(int16 argc, int16 *argv) {
|
||||
return AudioCD.isPlaying() ? 1 : 0;
|
||||
return g_system->getAudioCD()->isPlaying() ? 1 : 0;
|
||||
}
|
||||
|
||||
int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) {
|
||||
if (AudioCD.isPlaying()) {
|
||||
if (g_system->getAudioCD()->isPlaying()) {
|
||||
uint32 deltaTime = _vm->_system->getMillis() - _vm->_cdTimeStart;
|
||||
// This basically converts the time from milliseconds to MSF format to MADE's format
|
||||
return (deltaTime / 1000 * 30) + (deltaTime % 1000 / 75 * 30 / 75);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue