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

Function PreloadCache

source/games/blood/src/preload.cpp:206–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204//---------------------------------------------------------------------------
205
206void PreloadCache()
207{
208 if (!r_precache) return;
209 int skyTile = -1;
210 // Fonts
211 precacheMap();
212
213 BloodSpriteIterator it;
214 while (auto actor = it.Next())
215 {
216 switch (actor->spr.statnum)
217 {
218 case kStatDude:
219 PrecacheDude(actor);
220 break;
221 case kStatThing:
222 PrecacheThing(actor);
223 break;
224 default:
225 tilePrecacheTile(actor->spr.spritetexture(), -1, actor->spr.pal);
226 break;
227 }
228 }
229
230 // Precache common SEQs
231 for (int i = 0; i < 100; i++)
232 {
233 seqPrecacheId(i, 0);
234 }
235
236 tilePrecacheTile(aTexIds[kTexWATERDRIP], -1, 0); // water drip
237 tilePrecacheTile(aTexIds[kTexBLOODDRIP], -1, 0); // blood drip
238
239 // Player SEQs
240 seqPrecacheId(dudeInfo[31].seqStartID + 6, 0);
241 seqPrecacheId(dudeInfo[31].seqStartID + 7, 0);
242 seqPrecacheId(dudeInfo[31].seqStartID + 8, 0);
243 seqPrecacheId(dudeInfo[31].seqStartID + 9, 0);
244 seqPrecacheId(dudeInfo[31].seqStartID + 10, 0);
245 seqPrecacheId(dudeInfo[31].seqStartID + 14, 0);
246 seqPrecacheId(dudeInfo[31].seqStartID + 15, 0);
247 seqPrecacheId(dudeInfo[31].seqStartID + 12, 0);
248 seqPrecacheId(dudeInfo[31].seqStartID + 16, 0);
249 seqPrecacheId(dudeInfo[31].seqStartID + 17, 0);
250 seqPrecacheId(dudeInfo[31].seqStartID + 18, 0);
251
252 /* fixme: cache the composite sky. These are useless.
253 for (auto& sect : sector)
254 {
255 if ((sect.ceilingstat & CSTAT_SECTOR_SKY) != 0 && skyTile == -1)
256 skyTile = sect.ceilingtexture;
257 }
258 if (skyTile > -1 && skyTile < kMaxTiles)
259 {
260 for (int i = 1; i < gSkyCount; i++)
261 tilePrecacheTile(skyTile + i, 0, 0);
262 }
263 */

Callers 2

SerializeGameStateMethod · 0.85
StartLevelFunction · 0.85

Calls 12

precacheMapFunction · 0.85
PrecacheDudeFunction · 0.85
PrecacheThingFunction · 0.85
tilePrecacheTileFunction · 0.85
seqPrecacheIdFunction · 0.85
WeaponPrecacheFunction · 0.85
fxPrecacheFunction · 0.85
gibPrecacheFunction · 0.85
precacheMarkedTilesFunction · 0.85
spritetextureMethod · 0.80
I_GetEventFunction · 0.50
NextMethod · 0.45

Tested by

no test coverage detected