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

Function PageInShip

Descent3/gamesequence.cpp:2337–2423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2335// #define PAGED_IN_CALC paged_in_count ? (float)paged_in_count/(float)need_to_page_in : 0.0f
2336#define PAGED_IN_CALC paged_in_num ? (float)paged_in_num / (float)need_to_page_num : 0.0f
2337void PageInShip(int id) {
2338 int i, t;
2339
2340 ship *shippointer = &Ships[id];
2341
2342 // Page in all textures for this object
2343
2344 PageInPolymodel(shippointer->model_handle);
2345 Models_to_free[shippointer->model_handle] = 1;
2346
2347 poly_model *pm = &Poly_models[shippointer->model_handle];
2348
2349 for (t = 0; t < pm->n_textures; t++) {
2350 PageInLevelTexture(pm->textures[t]);
2351 // Create bumps if neccessary
2352 if (rend_SupportsBumpmapping()) {
2353 if (GameTextures[pm->textures[t]].bumpmap == -1) {
2354 mprintf(0, "Trying to make bumpmap!\n");
2355 BuildTextureBumpmaps(pm->textures[t]);
2356 }
2357 }
2358 }
2359
2360 LoadLevelProgress(LOAD_PROGRESS_PAGING_DATA, PAGED_IN_CALC);
2361 if (shippointer->med_render_handle != -1) {
2362 PageInPolymodel(shippointer->med_render_handle);
2363 Models_to_free[shippointer->med_render_handle] = 1;
2364
2365 pm = &Poly_models[shippointer->med_render_handle];
2366 for (t = 0; t < pm->n_textures; t++)
2367 PageInLevelTexture(pm->textures[t]);
2368 }
2369 LoadLevelProgress(LOAD_PROGRESS_PAGING_DATA, PAGED_IN_CALC);
2370 if (shippointer->lo_render_handle != -1) {
2371 PageInPolymodel(shippointer->lo_render_handle);
2372 Models_to_free[shippointer->lo_render_handle] = 1;
2373
2374 pm = &Poly_models[shippointer->lo_render_handle];
2375 for (t = 0; t < pm->n_textures; t++)
2376 PageInLevelTexture(pm->textures[t]);
2377 }
2378 LoadLevelProgress(LOAD_PROGRESS_PAGING_DATA, PAGED_IN_CALC);
2379 if (shippointer->dying_model_handle != -1) {
2380 PageInPolymodel(shippointer->dying_model_handle);
2381 Models_to_free[shippointer->dying_model_handle] = 1;
2382
2383 pm = &Poly_models[shippointer->dying_model_handle];
2384 for (t = 0; t < pm->n_textures; t++)
2385 PageInLevelTexture(pm->textures[t]);
2386 }
2387 LoadLevelProgress(LOAD_PROGRESS_PAGING_DATA, PAGED_IN_CALC);
2388 // Try and load the various weapons
2389 int j;
2390 if (shippointer->static_wb) {
2391 for (i = 0; i < MAX_PLAYER_WEAPONS; i++) {
2392 for (j = 0; j < MAX_WB_GUNPOINTS; j++) {
2393 if (shippointer->static_wb[i].gp_weapon_index[j] != LASER_INDEX) {
2394 PageInWeapon(shippointer->static_wb[i].gp_weapon_index[j]);

Callers 1

PageInAllDataFunction · 0.85

Calls 8

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

Tested by

no test coverage detected