MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PageInGeneric

Function PageInGeneric

Descent3/gamesequence.cpp:2425–2525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2423}
2424
2425void PageInGeneric(int id) {
2426 int i, t;
2427
2428 if (id == -1)
2429 return;
2430
2431 object_info *objinfopointer = &Object_info[id];
2432
2433 // Page in all textures for this object
2434
2435 PageInPolymodel(objinfopointer->render_handle);
2436 Models_to_free[objinfopointer->render_handle] = 1;
2437
2438 poly_model *pm = &Poly_models[objinfopointer->render_handle];
2439
2440 for (t = 0; t < pm->n_textures; t++) {
2441 PageInLevelTexture(pm->textures[t]);
2442
2443 // Create bumps if neccessary
2444 if (objinfopointer->type == OBJ_ROBOT && rend_SupportsBumpmapping()) {
2445 if (GameTextures[pm->textures[t]].bumpmap == -1)
2446 BuildTextureBumpmaps(pm->textures[t]);
2447 }
2448 }
2449
2450 if (objinfopointer->med_render_handle != -1) {
2451 PageInPolymodel(objinfopointer->med_render_handle);
2452 Models_to_free[objinfopointer->med_render_handle] = 1;
2453
2454 pm = &Poly_models[objinfopointer->med_render_handle];
2455 for (t = 0; t < pm->n_textures; t++)
2456 PageInLevelTexture(pm->textures[t]);
2457 }
2458
2459 if (objinfopointer->lo_render_handle != -1) {
2460 PageInPolymodel(objinfopointer->lo_render_handle);
2461 Models_to_free[objinfopointer->lo_render_handle] = 1;
2462
2463 pm = &Poly_models[objinfopointer->lo_render_handle];
2464 for (t = 0; t < pm->n_textures; t++)
2465 PageInLevelTexture(pm->textures[t]);
2466 }
2467
2468 // Process all sounds for this object
2469 for (i = 0; i < MAX_OBJ_SOUNDS; i++) {
2470 if (objinfopointer->sounds[i] != SOUND_NONE_INDEX) {
2471 PageInSound(objinfopointer->sounds[i]);
2472 }
2473 }
2474
2475 if (objinfopointer->ai_info) {
2476 for (i = 0; i < MAX_AI_SOUNDS; i++) {
2477 if (objinfopointer->ai_info->sound[i] != SOUND_NONE_INDEX) {
2478 PageInSound(objinfopointer->ai_info->sound[i]);
2479 }
2480 }
2481 }
2482 // Try and load the various wb sounds

Callers 3

PageInWeaponFunction · 0.85
PageInShipFunction · 0.85
PageInAllDataFunction · 0.85

Calls 6

PageInPolymodelFunction · 0.85
PageInLevelTextureFunction · 0.85
BuildTextureBumpmapsFunction · 0.85
PageInSoundFunction · 0.85
PageInWeaponFunction · 0.85
rend_SupportsBumpmappingFunction · 0.50

Tested by

no test coverage detected