X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapinfo.qh;h=6faef6e05716be116e414e9db8615186f2b618e4;hb=70b84d37e2cf1d5336c327cb43593024de2a2c6c;hp=19799df740069178ccc37aed0d8385a0c6ba169b;hpb=785232fc90ed7bd7038c79f65534a7e79efd7f45;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 19799df74..6faef6e05 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -38,22 +38,18 @@ CLASS(Gametype, Object) } ENDCLASS(Gametype) -void RegisterGametypes(); -const int MAX_MAPINFO_TYPES = 24; -entity MAPINFO_TYPES[MAX_MAPINFO_TYPES], MAPINFO_TYPES_first, MAPINFO_TYPES_last; -int MAPINFO_TYPE_COUNT; +REGISTRY(Gametypes, BIT(4)) +REGISTER_REGISTRY(RegisterGametypes) int MAPINFO_TYPE_ALL; - #define REGISTER_GAMETYPE(hname, sname, g_name, NAME, gteamplay, defaults, gdescription) \ int MAPINFO_TYPE_##NAME; \ - REGISTER(RegisterGametypes, MAPINFO_TYPE, MAPINFO_TYPES, MAPINFO_TYPE_COUNT, g_name, m_id, \ + REGISTER(RegisterGametypes, MAPINFO_TYPE, Gametypes, g_name, m_id, \ NEW(Gametype, hname, #sname, #g_name, gteamplay, defaults, gdescription) \ ) { \ /* same as `1 << m_id` */ \ MAPINFO_TYPE_##NAME = MAPINFO_TYPE_ALL + 1; MAPINFO_TYPE_ALL |= MAPINFO_TYPE_##NAME; \ this.items = MAPINFO_TYPE_##NAME; \ } -REGISTER_REGISTRY(RegisterGametypes) #define IS_GAMETYPE(NAME) \ (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)