]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
more channel cleanup
authorRudolf Polzer <divverent@xonotic.org>
Sun, 3 Jul 2011 16:59:08 +0000 (18:59 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 3 Jul 2011 16:59:08 +0000 (18:59 +0200)
config_update.cfg
qcsrc/client/target_music.qc
qcsrc/common/constants.qh
qcsrc/menu/xonotic/dialog_settings_audio.c
qcsrc/server/vehicles/racer.qc

index 6a6388a5bc4b2115342d4d009058085ce77a0e4b..f470875425711ad29ff89f9e2df2a3ad98594823 100644 (file)
@@ -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
index 87c9cc75a4ab9726562991976eb76211a9321b8e..c4573296a6bb0af9f35dedf39ae177855fc847bb 100644 (file)
@@ -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);
index 6cadfeb32b0f5727b163c3852c7a8f216db254f0..cc37ed57086fa58d6eeba5d9b1464a7b54599008 100644 (file)
@@ -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
index e38a87be66211eb41366ed773f891aca3d12b668..6e826749db37fe0009349d07b365c8c5a6876fdb 100644 (file)
@@ -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");
index 2f625c144c7fe593e86b954782ac50631bf12568..9fbd6541fc8e6af51254de34bc4a2eb9e772ff91 100644 (file)
@@ -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,