Patch 625904: CD Looping
svn-id: r5199
This commit is contained in:
parent
c7ef00571b
commit
628eea3de4
3 changed files with 28 additions and 5 deletions
|
@ -825,8 +825,11 @@ void OSystem_SDL_Common::play_cdrom(int track, int num_loops, int start_frame, i
|
|||
cd_num_loops = num_loops;
|
||||
cd_start_frame = start_frame;
|
||||
|
||||
SDL_CDStatus(_cdrom);
|
||||
SDL_CDPlayTracks(_cdrom, track, start_frame, 0, end_frame);
|
||||
SDL_CDStatus(_cdrom);
|
||||
if (start_frame == 0 && end_frame == 0)
|
||||
SDL_CDPlayTracks(_cdrom, track, 0, 1, 0);
|
||||
else
|
||||
SDL_CDPlayTracks(_cdrom, track, start_frame, 0, end_frame);
|
||||
cd_end_frame = end_frame;
|
||||
cd_stop_time = 0;
|
||||
cd_end_time = SDL_GetTicks() + _cdrom->track[track].length * 1000 / CD_FPS;
|
||||
|
@ -863,7 +866,10 @@ void OSystem_SDL_Common::update_cdrom() {
|
|||
cd_num_loops--;
|
||||
|
||||
if (cd_num_loops != 0) {
|
||||
SDL_CDPlayTracks(_cdrom, cd_track, cd_start_frame, 0, cd_end_frame);
|
||||
if (cd_start_frame == 0 && cd_end_frame == 0)
|
||||
SDL_CDPlayTracks(_cdrom, cd_track, 0, 1, 0);
|
||||
else
|
||||
SDL_CDPlayTracks(_cdrom, cd_track, cd_start_frame, 0, cd_end_frame);
|
||||
cd_end_time = SDL_GetTicks() + _cdrom->track[cd_track].length * 1000 / CD_FPS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue