From: Rudolf Polzer Date: Sun, 3 Jul 2011 16:59:08 +0000 (+0200) Subject: more channel cleanup X-Git-Tag: xonotic-v0.5.0~151^2~2^2~13 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=a1bf9ac8fe13b0cd7ede7a8acdc0ea6b57579c54;p=xonotic%2Fxonotic-data.pk3dir.git more channel cleanup --- diff --git a/config_update.cfg b/config_update.cfg index 6a6388a5b..f47087542 100644 --- a/config_update.cfg +++ b/config_update.cfg @@ -11,8 +11,11 @@ alias _update_configversion_2 "volume 1; cl_gunalign 1; _update_configversion_3" alias _update_configversion_3 "cl_gunalign 3; menu_cl_gunalign 3; _update_configversion_4" // place to put further updates -alias _update_configversion_4 "" +alias _update_configversion_4 "snd_entchannel0volume 1; snd_entchannel1volume 1; snd_entchannel2volume 1; snd_entchannel3volume 1; snd_entchannel4volume 1; snd_entchannel5volume 1; snd_entchannel6volume 1; snd_entchannel7volume 1; snd_playerchannel0volume 1; snd_playerchannel1volume 1; snd_playerchannel2volume 1; snd_playerchannel3volume 1; snd_playerchannel4volume 1; snd_playerchannel5volume 1; snd_playerchannel6volume 1; snd_playerchannel7volume 1; snd_worldchannel0volume 1; snd_worldchannel1volume 1; snd_worldchannel2volume 1; snd_worldchannel3volume 1; snd_worldchannel4volume 1; snd_worldchannel5volume 1; snd_worldchannel6volume 1; snd_worldchannel7volume 1; snd_csqcchannel0volume 1; snd_csqcchannel1volume 1; snd_csqcchannel2volume 1; snd_csqcchannel3volume 1; snd_csqcchannel4volume 1; snd_csqcchannel5volume 1; snd_csqcchannel6volume 1; snd_csqcchannel7volume 1; _update_configversion_5" + +// place to put further updates +alias _update_configversion_5 "" _update_configversion_$g_configversion -set g_configversion 4 +set g_configversion 5 diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index 87c9cc75a..c4573296a 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -19,7 +19,7 @@ void TargetMusic_Advance() for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); ) if(e.noise) { vol0 = e.lastvol; - if(getsoundtime(e, CH_BGM) < 0) + if(getsoundtime(e, CH_BGM_SINGLE) < 0) { vol0 = -1; } @@ -43,16 +43,16 @@ void TargetMusic_Advance() if(vol != vol0) { if(vol0 < 0) - sound(e, CH_BGM, e.noise, vol, ATTN_NONE); // restart + sound(e, CH_BGM_SINGLE, e.noise, vol, ATTN_NONE); // restart else - sound(e, CH_BGM, "", vol, ATTN_NONE); + sound(e, CH_BGM_SINGLE, "", vol, ATTN_NONE); e.lastvol = vol; } } music_trigger = world; if(best) - bgmtime = getsoundtime(best, CH_BGM); + bgmtime = getsoundtime(best, CH_BGM_SINGLE); else bgmtime = gettime(GETTIME_CDTRACK); } @@ -87,8 +87,8 @@ void Net_TargetMusic() strunzone(e.noise); e.noise = strzone(noi); precache_sound(e.noise); - sound(e, CH_BGM, e.noise, 0, ATTN_NONE); - if(getsoundtime(e, CH_BGM) < 0) + sound(e, CH_BGM_SINGLE, e.noise, 0, ATTN_NONE); + if(getsoundtime(e, CH_BGM_SINGLE) < 0) { print(sprintf(_("Cannot initialize sound %s\n"), e.noise)); strunzone(e.noise); @@ -175,8 +175,8 @@ void Ent_ReadTriggerMusic() if(self.noise != s) { precache_sound(self.noise); - sound(self, CH_BGM, self.noise, 0, ATTN_NONE); - if(getsoundtime(self, CH_BGM) < 0) + sound(self, CH_BGM_SINGLE, self.noise, 0, ATTN_NONE); + if(getsoundtime(self, CH_BGM_SINGLE) < 0) { print(sprintf(_("Cannot initialize sound %s\n"), self.noise)); strunzone(self.noise); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 6cadfeb32..cc37ed570 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -431,30 +431,28 @@ const float STAT_DOM_PPS_YELLOW = 104; #ifdef XON020_CHANNELS float CH_INFO = 0; // only on world and csqc -float CH_TRIGGER = 0; // only on players +float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info" float CH_WEAPON_A = 1; // only on players and entities -float CH_VOICE = 2; // only on players -float CH_BGM = 2; // only on csqc +float CH_VOICE = 2; // only on players; compat: FALSELY CONTROLLED BY "BGM" +float CH_BGM_SINGLE = 2; // only on csqc float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc float CH_WEAPON_B = 5; // only on players and entities float CH_PAIN = 6; // only on players and csqc float CH_PAIN_SINGLE = 6; // only on players and csqc float CH_PLAYER = 7; // only on players and entities -float CH_TRIGGER2_SINGLE = 6; // only on entities #else -float CH_INFO = 0; +float CH_INFO = 0; // only on world and csqc! float CH_TRIGGER = 256; float CH_WEAPON_A = 257; float CH_VOICE = 258; -float CH_BGM = 259; +float CH_BGM = 2; float CH_TRIGGER_SINGLE = 3; float CH_SHOTS_SINGLE = 4; float CH_WEAPON_B = 257; -float CH_PAIN = 260; +float CH_PAIN = 259; float CH_PAIN_SINGLE = 6; -float CH_PLAYER = 261; -float CH_TRIGGER2_SINGLE = 2; +float CH_PLAYER = 260; #endif #ifdef LEGACY_CHANS diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.c b/qcsrc/menu/xonotic/dialog_settings_audio.c index e38a87be6..6e826749d 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.c +++ b/qcsrc/menu/xonotic/dialog_settings_audio.c @@ -29,8 +29,9 @@ void XonoticAudioSettingsTab_fill(entity me) me.TR(me); me.TDempty(me, 0.2); s = makeXonoticDecibelsSlider(-20, 0, 0.5, "bgmvolume"); - makeMulti(s, "snd_csqcchannel2volume"); + makeMulti(s, "snd_channel259volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Music:"))); + makeMulti(s, "snd_channel2volume"); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); @@ -38,61 +39,58 @@ void XonoticAudioSettingsTab_fill(entity me) me.TDempty(me, 0.2); s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_staticvolume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, ZCTX(_("VOL^Ambient:")))); - makeMulti(s, "snd_entchannel2volume"); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_worldchannel0volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel0volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Info:"))); - makeMulti(s, "snd_csqcchannel0volume"); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_entchannel3volume"); - makeMulti(s, "snd_playerchannel0volume snd_playerchannel3volume snd_csqcchannel3volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel3volume"); + makeMulti(s, "snd_channel256volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Items:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel6volume"); - makeMulti(s, "snd_csqcchannel6volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel6volume"); + makeMulti(s, "snd_channel259volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Pain:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel7volume"); - makeMulti(s, "snd_entchannel7volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel260volume"); + makeMulti(s, "snd_channel7volume"); // legacy me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Player:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_entchannel4volume"); - makeMulti(s, "snd_playerchannel4volume snd_entchannel6volume snd_csqcchannel4volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel4volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Shots:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel2volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel258volume"); me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Voice:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); setDependentStringNotEqual(s, "mastervolume", "0"); me.TR(me); me.TDempty(me, 0.2); - s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel1volume"); - makeMulti(s, "snd_playerchannel5volume snd_entchannel1volume snd_entchannel5volume"); + s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_channel257volume"); + makeMulti(s, "snd_channel1volume snd_channel5volume"); // legacy me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Weapons:"))); me.TD(me, 1, 2, s); setDependentStringNotEqual(e, "mastervolume", "0"); diff --git a/qcsrc/server/vehicles/racer.qc b/qcsrc/server/vehicles/racer.qc index 2f625c144..9fbd6541f 100644 --- a/qcsrc/server/vehicles/racer.qc +++ b/qcsrc/server/vehicles/racer.qc @@ -358,13 +358,13 @@ float racer_frame() { //self.sounds = 2; self.strength_finished = time + 10.922667; //soundlength("vehicles/racer_boost.wav"); - sound (self, CH_TRIGGER2_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTN_NORM); + sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTN_NORM); } } else { self.strength_finished = 0; - sound (self, CH_TRIGGER2_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM); + sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM); } @@ -505,7 +505,7 @@ void racer_exit(float eject) self.think = racer_think; self.nextthink = time; self.movetype = MOVETYPE_TOSS; - sound (self, CH_TRIGGER2_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM); + sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM); if not (self.owner) return; @@ -609,7 +609,7 @@ void racer_dinit() if not (vehicle_initialize( "Wakizashi", "models/vehicles/wakizashi.dpm", - "", + "null", // we need this so tur_head is networked and usable for sounds "models/vehicles/wakizashi_cockpit.dpm", "", "", "tag_viewport", HUD_WAKIZASHI,