X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=inline;f=qcsrc%2Fclient%2Ftarget_music.qc;h=662a673d7999f901922507b07bc2fe8b974564d3;hb=256fc2b13ac54b138d204d660b4956bce004bc3b;hp=4bbbf03bc574582bb9981296d334e6ccc6998b9c;hpb=06794233e481364bed483b4d919dbc79505f2cda;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index 4bbbf03bc..662a673d7 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -1,11 +1,4 @@ -float music_disabled; -entity music_default; -entity music_target; -entity music_trigger; -// FIXME also control bgmvolume here, to not require a target_music for the default track. - -.float state; -.float lastvol; +#include "target_music.qh" void TargetMusic_Advance() { @@ -44,9 +37,9 @@ void TargetMusic_Advance() if(vol != vol0) { if(vol0 < 0) - sound(e, CH_BGM_SINGLE, e.noise, vol, ATTN_NONE); // restart + sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart else - sound(e, CH_BGM_SINGLE, "", vol, ATTN_NONE); + sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE); e.lastvol = vol; } } @@ -60,17 +53,14 @@ void TargetMusic_Advance() void Net_TargetMusic() { - float vol, fai, fao, tim, id; - string noi; - entity e; - - id = ReadShort(); - vol = ReadByte() / 255.0; - fai = ReadByte() / 16.0; - fao = ReadByte() / 16.0; - tim = ReadByte(); - noi = ReadString(); + int id = ReadShort(); + float vol = ReadByte() / 255.0; + float fai = ReadByte() / 16.0; + float fao = ReadByte() / 16.0; + float tim = ReadByte(); + string noi = ReadString(); + entity e; for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); ) { if(e.count == id) @@ -88,10 +78,10 @@ void Net_TargetMusic() strunzone(e.noise); e.noise = strzone(noi); precache_sound(e.noise); - sound(e, CH_BGM_SINGLE, e.noise, 0, ATTN_NONE); + sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE); if(getsoundtime(e, CH_BGM_SINGLE) < 0) { - print(sprintf(_("Cannot initialize sound %s\n"), e.noise)); + dprintf("Cannot initialize sound %s\n", e.noise); strunzone(e.noise); e.noise = string_null; } @@ -138,9 +128,7 @@ void Ent_TriggerMusic_Remove() void Ent_ReadTriggerMusic() { - float f; - string s; - f = ReadByte(); + int f = ReadByte(); if(f & 4) { self.origin_x = ReadCoord(); @@ -170,17 +158,17 @@ void Ent_ReadTriggerMusic() self.volume = ReadByte() / 255.0; self.fade_time = ReadByte() / 16.0; self.fade_rate = ReadByte() / 16.0; - s = self.noise; + string s = self.noise; if(self.noise) strunzone(self.noise); self.noise = strzone(ReadString()); if(self.noise != s) { precache_sound(self.noise); - sound(self, CH_BGM_SINGLE, self.noise, 0, ATTN_NONE); + sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); if(getsoundtime(self, CH_BGM_SINGLE) < 0) { - print(sprintf(_("Cannot initialize sound %s\n"), self.noise)); + dprintf("Cannot initialize sound %s\n", self.noise); strunzone(self.noise); self.noise = string_null; }