summaryrefslogtreecommitdiff
path: root/src/i_cdmus.c
diff options
context:
space:
mode:
authorSimon Howard2013-10-06 14:58:44 +0000
committerSimon Howard2013-10-06 14:58:44 +0000
commit6ec6095cb127421fc648781d0820d23d6e7a58a4 (patch)
treeeafd74cee78d87112b726c59d4e2f9576fb2370a /src/i_cdmus.c
parent9a4f30c23a7b87e5f5bf3e4e4039c845cba38d66 (diff)
downloadchocolate-doom-6ec6095cb127421fc648781d0820d23d6e7a58a4.tar.gz
chocolate-doom-6ec6095cb127421fc648781d0820d23d6e7a58a4.tar.bz2
chocolate-doom-6ec6095cb127421fc648781d0820d23d6e7a58a4.zip
Finish implementation of Hexen CD audio music mode.
Subversion-branch: /branches/v2-branch Subversion-revision: 2694
Diffstat (limited to 'src/i_cdmus.c')
-rw-r--r--src/i_cdmus.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/i_cdmus.c b/src/i_cdmus.c
index 94ac47c6..d05b5bd1 100644
--- a/src/i_cdmus.c
+++ b/src/i_cdmus.c
@@ -42,8 +42,20 @@ int I_CDMusInit(void)
{
int drive_num = 0;
+ // The initialize function is re-invoked when the CD track play cheat
+ // is used, so use the opportunity to call SDL_CDStatus() to update
+ // the status of the drive.
+ // TODO: Check this actually works.
+
+ if (cd_handle != NULL)
+ {
+ SDL_CDStatus(cd_handle);
+ cd_Error = 0;
+ return 0;
+ }
+
// TODO: config variable to control CDROM to use.
-
+
cd_handle = SDL_CDOpen(drive_num);
if (cd_handle == NULL)
@@ -53,6 +65,8 @@ int I_CDMusInit(void)
return -1;
}
+ printf("I_CDMusInit: Using CD-ROM drive: %s\n", SDL_CDName(drive_num));
+
if (!CD_INDRIVE(cd_handle->status))
{
fprintf(stderr, "I_CDMusInit: '%s': no CD in drive.\n",
@@ -139,8 +153,7 @@ int I_CDMusFirstTrack(void)
}
}
- /* Don't know? */
-
+ // Don't know?
cd_Error = 1;
return -1;