Xonotic
|
#include "oo.qh"
Go to the source code of this file.
Macros | |
#define | _R_DEL(r) AL_DELETE(r) |
#define | _R_GET(r, i) AL_gete(r, i) |
#define | _R_MAP(r, max) ArrayList r; STATIC_INIT(r) { AL_NEW(r, max, NULL, e); } |
#define | _R_SET(r, i, e) AL_sete(r, i, e) |
#define | _REGISTER_REGISTRY(id, str) |
#define | EVAL_REGISTER(...) __VA_ARGS__ |
#define | EVAL_REGISTRY_SORT(...) __VA_ARGS__ |
#define | REGISTER(...) EVAL_REGISTER(OVERLOAD_(REGISTER, __VA_ARGS__)) |
Register a new entity with a registry. More... | |
#define | REGISTER_4(registry, id, fld, inst) |
#define | REGISTER_5(registry, ns, id, fld, inst) REGISTER_4(registry, ns##_##id, fld, inst) |
#define | REGISTER_INIT(id) ACCUMULATE void Register_##id##_init(entity this) |
#define | REGISTER_REGISTRY(id) _REGISTER_REGISTRY(id, #id) |
#define | REGISTRY(id, max) |
Declare a new registry. More... | |
#define | REGISTRY_BEGIN(id) ACCUMULATE void REGISTRY_BEGIN_(id) { noref void() f = Register##id; } void REGISTRY_BEGIN_(id) |
Called before initializing a registry. More... | |
#define | REGISTRY_BEGIN_(id) Register##id##_First() |
#define | REGISTRY_CHECK(id) |
#define | REGISTRY_COUNT(id) id##_COUNT |
#define | REGISTRY_DEFINE_GET(id, null) entity id##_from(int i) { if (i >= 0 && i < id##_COUNT) { entity e = _R_GET(_##id, i); if (e) return e; } return null; } |
#define | REGISTRY_DEPENDS(id, dep) void Register##dep(); void REGISTRY_DEPENDS_(id) { Register##dep(); } |
Add registry dependencies to a registry. More... | |
#define | REGISTRY_DEPENDS_(id) Register##id##_Depends() |
#define | REGISTRY_END(id) ACCUMULATE void REGISTRY_END_(id) { noref void() f = Register##id; } void REGISTRY_END_(id) |
Called after initializing a registry. More... | |
#define | REGISTRY_END_(id) Register##id##_Done() |
#define | REGISTRY_GET(id, i) id##_from(i) |
#define | REGISTRY_HASH(id) Registry_hash_##id |
#define | REGISTRY_MAX(id) id##_MAX |
#define | REGISTRY_NEXT enemy |
internal next pointer More... | |
#define | REGISTRY_PUSH(registry, fld, it) |
#define | REGISTRY_RESERVE(registry, fld, id, suffix) |
#define | Registry_send(id, hash) |
#define | REGISTRY_SORT(...) EVAL_REGISTRY_SORT(OVERLOAD(REGISTRY_SORT, __VA_ARGS__)) |
#define | REGISTRY_SORT_1(id) REGISTRY_SORT_2(id, 0) |
#define | REGISTRY_SORT_2(id, skip) |
Functions | |
void | _regCheck (int i, int _max) |
ERASEABLE ACCUMULATE void | Registry_check (string r, string sv) |
ERASEABLE ACCUMULATE void | Registry_send_all () |
Variables | |
string | registered_id |
registered item identifier More... | |
entity | REGISTRY_NEXT |
#define _R_DEL | ( | r | ) | AL_DELETE(r) |
Definition at line 9 of file registry.qh.
#define _R_GET | ( | r, | |
i | |||
) | AL_gete(r, i) |
Definition at line 7 of file registry.qh.
Definition at line 6 of file registry.qh.
#define _R_SET | ( | r, | |
i, | |||
e | |||
) | AL_sete(r, i, e) |
Definition at line 8 of file registry.qh.
#define _REGISTER_REGISTRY | ( | id, | |
str | |||
) |
Definition at line 199 of file registry.qh.
#define EVAL_REGISTER | ( | ... | ) | __VA_ARGS__ |
Definition at line 88 of file registry.qh.
#define EVAL_REGISTRY_SORT | ( | ... | ) | __VA_ARGS__ |
Definition at line 129 of file registry.qh.
#define REGISTER | ( | ... | ) | EVAL_REGISTER(OVERLOAD_(REGISTER, __VA_ARGS__)) |
Register a new entity with a registry.
Must be followed by a semicolon or a function body with a this
parameter. Wrapper macros may perform actions after user initialization like so: #define REGISTER_FOO(id) \ REGISTER(Foos, FOO, id, m_id, NEW(Foo)) { \ print("Registering foo #", this.m_id + 1, "\n"); \ } \ REGISTER_INIT(FOO, id)
registry | The registry to add each entity to. |
ns | Short for namespace, prefix for each global (ns##_##id) |
id | The identifier of the current entity being registered |
fld | The field to store the locally unique unique entity id |
inst | An expression to create a new instance, invoked for every registration |
Definition at line 87 of file registry.qh.
#define REGISTER_4 | ( | registry, | |
id, | |||
fld, | |||
inst | |||
) |
Definition at line 90 of file registry.qh.
#define REGISTER_5 | ( | registry, | |
ns, | |||
id, | |||
fld, | |||
inst | |||
) | REGISTER_4(registry, ns##_##id, fld, inst) |
Definition at line 89 of file registry.qh.
#define REGISTER_INIT | ( | id | ) | ACCUMULATE void Register_##id##_init(entity this) |
Definition at line 122 of file registry.qh.
#define REGISTER_REGISTRY | ( | id | ) | _REGISTER_REGISTRY(id, #id) |
Definition at line 212 of file registry.qh.
Referenced by Gametype::Gametype ::gametype_init().
#define REGISTRY | ( | id, | |
max | |||
) |
Declare a new registry.
Don't forget to call REGISTER_REGISTRY and REGISTRY_DEFINE_GET: REGISTER_REGISTRY(Foos) REGISTRY_DEFINE_GET(Foos, null_ent)
Definition at line 26 of file registry.qh.
Referenced by Gametype::Gametype ::gametype_init(), and Mutator::Mutator ::Mutator().
#define REGISTRY_BEGIN | ( | id | ) | ACCUMULATE void REGISTRY_BEGIN_(id) { noref void() f = Register##id; } void REGISTRY_BEGIN_(id) |
Called before initializing a registry.
Definition at line 50 of file registry.qh.
#define REGISTRY_BEGIN_ | ( | id | ) | Register##id##_First() |
Definition at line 51 of file registry.qh.
#define REGISTRY_CHECK | ( | id | ) |
Definition at line 175 of file registry.qh.
Referenced by Gametype::Gametype ::gametype_init(), and STATIC_INIT().
#define REGISTRY_COUNT | ( | id | ) | id##_COUNT |
Definition at line 18 of file registry.qh.
Referenced by havocbot_chooseweapon(), HUD_Configure_Frame(), HUD_Main(), HUD_Panel_Check_Mouse_Pos(), HUD_Panel_CheckMove(), HUD_Panel_CheckResize(), HUD_Panel_ExportCfg(), HUD_Panel_FirstInDrawQ(), HUD_Panel_Highlight(), HUD_Panel_InputEvent(), HUD_Weapons(), reset_tab_panels(), Scoreboard_AccuracyStats_Draw(), and Scoreboard_ItemStats_Draw().
#define REGISTRY_DEFINE_GET | ( | id, | |
null | |||
) | entity id##_from(int i) { if (i >= 0 && i < id##_COUNT) { entity e = _R_GET(_##id, i); if (e) return e; } return null; } |
Definition at line 40 of file registry.qh.
Referenced by Gametype::Gametype ::gametype_init(), Mutator::Mutator ::Mutator(), Nade::Nade ::display(), and PRECACHE().
#define REGISTRY_DEPENDS | ( | id, | |
dep | |||
) | void Register##dep(); void REGISTRY_DEPENDS_(id) { Register##dep(); } |
Add registry dependencies to a registry.
Definition at line 46 of file registry.qh.
#define REGISTRY_DEPENDS_ | ( | id | ) | Register##id##_Depends() |
Definition at line 47 of file registry.qh.
#define REGISTRY_END | ( | id | ) | ACCUMULATE void REGISTRY_END_(id) { noref void() f = Register##id; } void REGISTRY_END_(id) |
Called after initializing a registry.
Definition at line 54 of file registry.qh.
#define REGISTRY_END_ | ( | id | ) | Register##id##_Done() |
Definition at line 55 of file registry.qh.
#define REGISTRY_GET | ( | id, | |
i | |||
) | id##_from(i) |
Definition at line 43 of file registry.qh.
Referenced by _StartItem(), bot_cmd_select_weapon(), BUFF_NAME(), CL_Weapon_GetShotOrg(), Deathtype_Name(), fixPriorityList(), Get_Notif_Ent(), GiveWeapon(), havocbot_chooseweapon(), HUD_Configure_Frame(), HUD_Crosshair_Vehicle(), HUD_Main(), HUD_Panel_Check_Mouse_Pos(), HUD_Panel_CheckMove(), HUD_Panel_CheckResize(), HUD_Panel_ExportCfg(), HUD_Panel_Highlight(), HUD_Panel_InputEvent(), HUD_Radar(), HUD_Vehicle(), Item_GiveTo(), Item_RespawnCountdown(), MDL_GIB_ROBO_RANDOM(), MDL_NUM(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), NIX_CanChooseWeapon(), NIX_GiveCurrentWeapon(), notif_arg_item_wepammo(), Obituary_SpecialDeath(), Projectile_DrawTrail(), ServerList_TypeSort_Click(), SND_GIB_SPLAT_RANDOM(), SND_GRENADE_BOUNCE_RANDOM(), SND_HAGEXP_RANDOM(), SND_NEXWHOOSH_RANDOM(), SND_RIC_RANDOM(), STATIC_INIT(), View_EventChase(), W_CycleWeapon(), W_DropEvent(), W_FixWeaponOrder_BuildImpulseList_cmp(), W_GetCycleWeapon(), W_GiveWeapon(), W_IsWeaponThrowable(), W_LastWeapon(), W_Model(), W_NameWeaponOrder_MapFunc(), W_NextWeaponOnImpulse(), W_ThrowNewWeapon(), weapon_byid_handle(), XonoticWeaponsList_drawListBoxItem(), and XonoticWeaponsList_toString().
#define REGISTRY_HASH | ( | id | ) | Registry_hash_##id |
Definition at line 162 of file registry.qh.
#define REGISTRY_MAX | ( | id | ) | id##_MAX |
Definition at line 17 of file registry.qh.
Referenced by _WepSet_FromWeapon(), accuracy_reset(), HUD_Weapons(), Item_ItemsTime_Allow(), and STATIC_INIT().
#define REGISTRY_NEXT enemy |
internal next pointer
Definition at line 125 of file registry.qh.
#define REGISTRY_PUSH | ( | registry, | |
fld, | |||
it | |||
) |
Definition at line 107 of file registry.qh.
#define REGISTRY_RESERVE | ( | registry, | |
fld, | |||
id, | |||
suffix | |||
) |
Definition at line 116 of file registry.qh.
#define Registry_send | ( | id, | |
hash | |||
) |
Definition at line 172 of file registry.qh.
Referenced by Registry_send_all().
#define REGISTRY_SORT | ( | ... | ) | EVAL_REGISTRY_SORT(OVERLOAD(REGISTRY_SORT, __VA_ARGS__)) |
Definition at line 128 of file registry.qh.
#define REGISTRY_SORT_1 | ( | id | ) | REGISTRY_SORT_2(id, 0) |
Definition at line 130 of file registry.qh.
#define REGISTRY_SORT_2 | ( | id, | |
skip | |||
) |
Definition at line 131 of file registry.qh.
ERASEABLE ACCUMULATE void Registry_check | ( | string | r, |
string | sv | ||
) |
ERASEABLE ACCUMULATE void Registry_send_all | ( | ) |
Definition at line 167 of file registry.qh.
References Registry_send.
Referenced by ClientInit_SendEntity().
string registered_id |
registered item identifier
Definition at line 60 of file registry.qh.
entity REGISTRY_NEXT |
Definition at line 126 of file registry.qh.