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

Function init_cache

src/SB/Game/zEntPlayerBungeeState.cpp:892–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890 }
891
892 void init_cache()
893 {
894 shared.hook_cache_size = 0;
895 zScene& s = *globals.sceneCur;
896 hook_type* it = (hook_type*)s.baseList[eBaseTypeBungeeHook];
897 hook_type* end = it + s.baseCount[eBaseTypeBungeeHook];
898 for (; it != end; ++it)
899 {
900 cache_hook(*it);
901 }
902
903 shared.drop_cache_size = 0;
904 S32 imax = xSTAssetCountByType('DYNA');
905 U32 drop_type_id = xStrHash(drop_asset::type_name());
906 for (S32 i = 0; i < imax; ++i)
907 {
908 U32 size = 0;
909 xDynAsset* a = (xDynAsset*)xSTFindAssetByType('DYNA', i, &size);
910 if (a == NULL)
911 {
912 continue;
913 }
914 if (a->type == drop_type_id)
915 {
916 cache_drop(*(drop_asset*)a, size);
917 }
918 }
919 }
920
921 void common_update(xScene& sc, F32 dt)
922 {

Callers 1

initFunction · 0.70

Calls 5

cache_hookFunction · 0.85
cache_dropFunction · 0.85
xSTAssetCountByTypeFunction · 0.50
xStrHashFunction · 0.50
xSTFindAssetByTypeFunction · 0.50

Tested by

no test coverage detected