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

Function mng_LoadNetGenericPage

manage/generic.cpp:2197–2216  ·  view source on GitHub ↗

Loads a generic found in the net table file. It then allocs a generic and then calls SetAndLoadgeneric to actually load in any images/models associated with it

Source from the content-addressed store, hash-verified

2195// then calls SetAndLoadgeneric to actually load in any images/models associated
2196// with it
2197void mng_LoadNetGenericPage(CFILE *infile, bool overlay) {
2198 mngs_generic_page genericpage;
2199 memset(&genericpage, 0, sizeof(mngs_generic_page));
2200
2201 if (mng_ReadNewGenericPage(infile, &genericpage)) {
2202 int n = FindObjectIDName(genericpage.objinfo_struct.name);
2203 if (n != -1) {
2204 if (overlay) {
2205 mprintf(0, "OVERLAYING GENERIC %s\n", genericpage.objinfo_struct.name);
2206 mng_FreePagetypePrimitives(PAGETYPE_GENERIC, genericpage.objinfo_struct.name, 0);
2207 mng_AssignGenericPageToObjInfo(&genericpage, n);
2208 }
2209 return; // A weapon has already loaded this generic
2210 }
2211
2212 int ret = mng_SetAndLoadGeneric(&genericpage, infile);
2213 ASSERT(ret >= 0);
2214 } else
2215 mprintf(0, "Could not load genericpage named %s!\n", genericpage.objinfo_struct.name);
2216}
2217
2218// Reads a generic page from a local table file. It then allocs a generic and
2219// loads any images/models associated with that generic

Callers 1

mng_LoadNetPagesFunction · 0.85

Calls 5

mng_ReadNewGenericPageFunction · 0.85
FindObjectIDNameFunction · 0.85
mng_SetAndLoadGenericFunction · 0.85

Tested by

no test coverage detected