MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / XOrdInit

Function XOrdInit

src/SB/Core/x/xordarray.cpp:6–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <types.h>
5
6void XOrdInit(st_XORDEREDARRAY* array, S32 size, S32 tempAlloc)
7{
8 S32 cnt = 1;
9 if (size >= 1)
10 {
11 cnt = size;
12 }
13 if (tempAlloc)
14 {
15 array->list = (void**)xMemPushTemp(cnt << 2);
16 }
17 else
18 {
19 array->list = (void**)xMemAlloc(gActiveHeap, cnt << 2, 0);
20 }
21 array->cnt = 0;
22 array->max = cnt;
23 array->warnlvl = 0.95f * (cnt ^ (S32)0.0);
24 if (array->warnlvl == array->max)
25 {
26 cnt = array->max - 1;
27 array->warnlvl = cnt & ~(cnt >> 0x1f);
28 }
29}
30
31void XOrdReset(st_XORDEREDARRAY* array)
32{

Callers 11

zNPCSpawner_ScenePrepareFunction · 0.85
SubscribeMethod · 0.85
NPCPS_MsgPoolInitFunction · 0.85
NPCPS_CltPoolInitFunction · 0.85
ScenePrepareMethod · 0.85
xSER_init_buffersFunction · 0.85
PKR_parse_TOCFunction · 0.85
PKR_newlaynodeFunction · 0.85
PKR_bld_typecntFunction · 0.85
StartupMethod · 0.85
xFactoryMethod · 0.85

Calls 2

xMemPushTempFunction · 0.70
xMemAllocFunction · 0.70

Tested by

no test coverage detected