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

Function AllocPolyModel

model/polymodel.cpp:728–740  ·  view source on GitHub ↗

Sets aside a polymodel for use Errors and returns -1 if none free

Source from the content-addressed store, hash-verified

726// Sets aside a polymodel for use
727// Errors and returns -1 if none free
728int AllocPolyModel() {
729 for (int i = 0; i < MAX_POLY_MODELS; i++)
730 if (Poly_models[i].used == 0) {
731 WBClearInfo(&Poly_models[i]);
732 memset(&Poly_models[i], 0, sizeof(poly_model));
733 Poly_models[i].used = 1;
734 Poly_models[i].flags |= PMF_NOT_RESIDENT; // not in memory yet!
735 return i;
736 }
737
738 Error("Couldn't find a free polymodel!");
739 return -1;
740}
741
742// Frees all the polymodel data, but doesn't free the actual polymodel itself
743void FreePolymodelData(int i) {

Callers 1

LoadPolyModelFunction · 0.85

Calls 2

ErrorFunction · 0.85
WBClearInfoFunction · 0.70

Tested by

no test coverage detected