From 62e05bc4243937caf7265a21977d0ef6ead14166 Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 21 Jul 2008 18:52:05 +0000 Subject: [PATCH] persist musicvol git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2190 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 2 +- source/src/sound.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index e15e4b49..11217183 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -326,7 +326,7 @@ void flagdropped(int flag, int action, short x, short y, short z) p.o.y = y; p.o.z = z; p.vel.z = -0.8f; - loopi(50) moveplayer(&p, 50, true); // calc drop position + loopi(10) moveplayer(&p, 10, true, 50); // calc drop position f.flag->x = (short)p.o.x; f.flag->y = (short)p.o.y; f.flag->z = (short)p.o.z; diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 39305f11..c64d65b0 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -32,6 +32,7 @@ bool alerr(bool msg = true) return er > 0; } +// provides an interface for callbacks. struct sourceowner { @@ -503,7 +504,6 @@ struct oggstream } } - if(!active) reset(); return active; } @@ -974,7 +974,7 @@ VARFP(soundvol, 0, 128, 255, void setmusicvol() { extern int musicvol; - if(gamemusic) gamemusic->setvolume(musicvol/255.0f); + if(gamemusic) gamemusic->setvolume(musicvol > 0 ? musicvol/255.0f : 0); } VARFP(musicvol, 0, 64, 255, setmusicvol()); @@ -1074,6 +1074,7 @@ void music(char *name, char *millis, char *cmd) { conoutf("could not play music: %s", name); } + setmusicvol(); } else conoutf("could not open music: %s", name); }