X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fsounds%2Fall.qh;h=6d011e21ad0b3f9cb29102fc438fca1e47233b7c;hp=4ad0e9b102cbc214eaf01876ecd83ba1f9f841c1;hb=717defe5e02506bb5c857025d71fb605d6eb8c55;hpb=0cdb1b7f5c95d832b0d9269fed155bcb01870cf3 diff --git a/qcsrc/common/sounds/all.qh b/qcsrc/common/sounds/all.qh index 4ad0e9b10..6d011e21a 100644 --- a/qcsrc/common/sounds/all.qh +++ b/qcsrc/common/sounds/all.qh @@ -1,26 +1,22 @@ -#ifndef SOUNDS_ALL_H -#define SOUNDS_ALL_H +#pragma once #include "sound.qh" -REGISTRY(Sounds, BITS(8)) -#define Sounds_from(i) _Sounds_from(i, SND_Null) -REGISTER_REGISTRY(RegisterSounds) +REGISTRY(Sounds, BITS(9)) +REGISTER_REGISTRY(Sounds) #define SOUND(name, path) \ string SND_##name##_get() { return path; } \ - REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get)) + REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get)) -// Used in places where a string is required +/** @deprecated Used in places where a string is required for legacy reasons, prefer using SND_id constants instead */ #define SND(id) Sound_fixpath(SND_##id) PRECACHE(Sounds) { - FOREACH(Sounds, true, LAMBDA({ - it.sound_precache(it); - })); + FOREACH(Sounds, true, it.sound_precache(it)); } SOUND(Null, "misc/null"); +REGISTRY_DEFINE_GET(Sounds, SND_Null) #include "all.inc" - -#endif +#include "all.qc"