MCPcopy Create free account
hub / github.com/ZDoom/Raze / doprecache

Function doprecache

source/core/precache.cpp:62–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static void doprecache(FTextureID texid, int palette)
63{
64 if ((palette < (MAXPALOOKUPS - RESERVEDPALS)) && (!lookups.checkTable(palette))) return;
65
66 int palid = TRANSLATION(Translation_Remap + curbasepal, palette).index();
67 auto tex = TexMan.GetGameTexture(texid);
68 PrecacheTex(tex, palid);
69
70 int const mid = -1;// hw_models ? modelManager.CheckModel(texid, palette) : -1;
71
72 if (mid < 0)
73 {
74 if (r_voxels)
75 {
76 int vox = GetExtInfo(texid).tiletovox;
77 if (vox >= 0 && vox < MAXVOXELS && voxmodels[vox] && voxmodels[vox]->model)
78 {
79 FHWModelRenderer mr(*screen->RenderState(), 0);
80 voxmodels[vox]->model->BuildVertexBuffer(&mr);
81 }
82 }
83 return;
84 }
85
86#if 0
87 int const surfaces = (models[mid]->mdnum == 3) ? ((md3model_t *)models[mid])->head.numsurfs : 0;
88
89 for (int i = 0; i <= surfaces; i++)
90 {
91 auto skintex = mdloadskin((md2model_t *)models[mid], 0, palette, i, nullptr);
92 int paletteid = TRANSLATION(Translation_Remap + curbasepal, palette);
93 if (skintex) PrecacheTex(skintex, paletteid);
94 }
95#endif
96}
97
98
99TMap<int64_t, bool> cachemap;

Callers 1

precacheMarkedTilesFunction · 0.85

Calls 8

TRANSLATIONFunction · 0.85
PrecacheTexFunction · 0.85
mdloadskinFunction · 0.85
checkTableMethod · 0.80
GetGameTextureMethod · 0.80
indexMethod · 0.45
RenderStateMethod · 0.45
BuildVertexBufferMethod · 0.45

Tested by

no test coverage detected