mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
nilrider:: reverted duration check
This commit is contained in:
parent
4d3a9081a9
commit
f02b385138
@ -435,7 +435,6 @@ void save(string s) {
|
||||
}
|
||||
|
||||
auto wfc_hook =
|
||||
addHook(hooks_handleKey, 100, wfc_handleKey) +
|
||||
addHook(hooks_args, 100, [] {
|
||||
using namespace arg;
|
||||
|
||||
@ -450,6 +449,9 @@ auto wfc_hook =
|
||||
else if(argis("-dynamic-wfc-save")) {
|
||||
shift(); save(args());
|
||||
}
|
||||
else if(argis("-wfc-regen-key")) {
|
||||
rogueviz::rv_hook(hooks_handleKey, 100, wfc_handleKey);
|
||||
}
|
||||
|
||||
else return 1;
|
||||
return 0;
|
||||
|
@ -67,37 +67,7 @@ bool crash_sound = true;
|
||||
bool running;
|
||||
bool backing;
|
||||
|
||||
static double music_internal_duration(Mix_Music *music)
|
||||
{
|
||||
if (music->interface->Duration) {
|
||||
return music->interface->Duration(music->context);
|
||||
} else {
|
||||
Mix_SetError("Duration not implemented for music type");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
double MIXCALLCC Mix_MusicDuration(Mix_Music *music)
|
||||
{
|
||||
double retval;
|
||||
|
||||
Mix_LockAudio();
|
||||
if (music) {
|
||||
retval = music_internal_duration(music);
|
||||
} else if (music_playing) {
|
||||
retval = music_internal_duration(music_playing);
|
||||
} else {
|
||||
Mix_SetError("music is NULL and no playing music");
|
||||
retval = -1.0;
|
||||
}
|
||||
Mix_UnlockAudio();
|
||||
|
||||
return(retval);
|
||||
}
|
||||
|
||||
void sync_music(eLand l) {
|
||||
if(music[laCanvas])
|
||||
println(hlog, "duration = ", Mix_MusicDuration(music[laCanvas]));
|
||||
musicpos[laCanvas] = curlev->current.timer * 1000;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user