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

Function PageInWeapon

Descent3/gamesequence.cpp:2271–2329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2269}
2270
2271void PageInWeapon(int id) {
2272 weapon *weaponpointer = &Weapons[id];
2273
2274 if (id == -1)
2275 return;
2276
2277 int i;
2278
2279 if (!(weaponpointer->flags & (WF_IMAGE_BITMAP | WF_IMAGE_VCLIP))) {
2280 PageInPolymodel(weaponpointer->fire_image_handle);
2281 Models_to_free[weaponpointer->fire_image_handle] = 1;
2282
2283 poly_model *pm = &Poly_models[weaponpointer->fire_image_handle];
2284 for (int t = 0; t < pm->n_textures; t++)
2285 PageInLevelTexture(pm->textures[t]);
2286 }
2287
2288 // Load the various textures associated with this weapon
2289 if (weaponpointer->explode_image_handle != -1) {
2290 PageInLevelTexture(weaponpointer->explode_image_handle);
2291 }
2292
2293 if (weaponpointer->particle_handle != -1) {
2294 PageInLevelTexture(weaponpointer->particle_handle);
2295 }
2296
2297 if (weaponpointer->smoke_handle != -1) {
2298 PageInLevelTexture(weaponpointer->smoke_handle);
2299 }
2300
2301 if (weaponpointer->scorch_handle != -1) {
2302 PageInLevelTexture(weaponpointer->scorch_handle);
2303 }
2304
2305 if (weaponpointer->icon_handle != -1) {
2306 PageInLevelTexture(weaponpointer->icon_handle);
2307 }
2308
2309 // Try to load spawn weapons
2310 if (weaponpointer->spawn_handle != -1 && weaponpointer->spawn_count > 0 && weaponpointer->spawn_handle != id) {
2311 PageInWeapon(weaponpointer->spawn_handle);
2312 }
2313
2314 if (weaponpointer->alternate_spawn_handle != -1 && weaponpointer->spawn_count > 0 &&
2315 weaponpointer->alternate_spawn_handle != id) {
2316 PageInWeapon(weaponpointer->alternate_spawn_handle);
2317 }
2318
2319 if (weaponpointer->robot_spawn_handle != -1) {
2320 PageInGeneric(weaponpointer->robot_spawn_handle);
2321 }
2322
2323 // Try and load the various sounds
2324 for (i = 0; i < MAX_WEAPON_SOUNDS; i++) {
2325 if (weaponpointer->sounds[i] != SOUND_NONE_INDEX) {
2326 PageInSound(weaponpointer->sounds[i]);
2327 }
2328 }

Callers 2

PageInShipFunction · 0.85
PageInGenericFunction · 0.85

Calls 4

PageInPolymodelFunction · 0.85
PageInLevelTextureFunction · 0.85
PageInGenericFunction · 0.85
PageInSoundFunction · 0.85

Tested by

no test coverage detected