From e3bbeb9917678b4dc5c0bf5b74673217c176732d Mon Sep 17 00:00:00 2001 From: Nishi Date: Wed, 27 May 2026 23:56:20 +0900 Subject: [PATCH] fix --- client/main.cc | 2 +- engine/src/soundldr/xmp.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.cc b/client/main.cc index 1f2d391..201d86a 100644 --- a/client/main.cc +++ b/client/main.cc @@ -21,7 +21,7 @@ int main(){ drv = new fishbone::SoundDriver(); - snd = drv->mixer.open("dubmood.xm"); + snd = drv->mixer.open("betrayal.mod"); snd->setLoop(true); snd->resume(); diff --git a/engine/src/soundldr/xmp.cc b/engine/src/soundldr/xmp.cc index 58412e7..f2f0a77 100644 --- a/engine/src/soundldr/xmp.cc +++ b/engine/src/soundldr/xmp.cc @@ -33,13 +33,13 @@ fishbone::Sound* fishbone::XMPSoundLoader::open(fishbone::Mixer* mixer, void* bu } int fishbone::XMPSoundLoader::read(fishbone::Sound* sound, short* buffer, size_t frames) { - if(xmp_play_buffer(sound->impl->ctx, buffer, frames * 4, 0) < 0) return -1; + if(xmp_play_buffer(sound->impl->ctx, buffer, frames * 4, sound->isLoop() ? 0 : 1) < 0) return -1; return frames; } void fishbone::XMPSoundLoader::seek(fishbone::Sound* sound, size_t pos) { - xmp_set_position(sound->impl->ctx, pos); + if(pos == 0) xmp_seek_time(sound->impl->ctx, 0); } fishbone::XMPSound::~XMPSound() {