X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Ftarget_music.qc;h=662a673d7999f901922507b07bc2fe8b974564d3;hb=82dbcadfd0556053b74638f2e3ae2e57103ddf26;hp=fa116dc731625ccc8e99afba627bd59049681004;hpb=c3f6bc06517a43e4de33d2a9148cdb36dbfc2ab8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index fa116dc73..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() { @@ -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) @@ -91,7 +81,7 @@ void Net_TargetMusic() sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE); if(getsoundtime(e, CH_BGM_SINGLE) < 0) { - printf(_("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,7 +158,7 @@ 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()); @@ -180,7 +168,7 @@ void Ent_ReadTriggerMusic() sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); if(getsoundtime(self, CH_BGM_SINGLE) < 0) { - printf(_("Cannot initialize sound %s\n"), self.noise); + dprintf("Cannot initialize sound %s\n", self.noise); strunzone(self.noise); self.noise = string_null; }