Sets aside a polymodel for use Errors and returns -1 if none free
| 726 | // Sets aside a polymodel for use |
| 727 | // Errors and returns -1 if none free |
| 728 | int 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 |
| 743 | void FreePolymodelData(int i) { |
no test coverage detected