Gets next sound from n that has actually been alloced
| 514 | |
| 515 | // Gets next sound from n that has actually been alloced |
| 516 | int GetNextSound(int n) { |
| 517 | int i; |
| 518 | |
| 519 | ASSERT(n >= 0 && n < MAX_SOUNDS); |
| 520 | |
| 521 | if (Num_sounds == 0) |
| 522 | return -1; |
| 523 | |
| 524 | for (i = n + 1; i < MAX_SOUNDS; i++) |
| 525 | if (Sounds[i].used) |
| 526 | return i; |
| 527 | for (i = 0; i < n; i++) |
| 528 | if (Sounds[i].used) |
| 529 | return i; |
| 530 | |
| 531 | // this is the only one |
| 532 | |
| 533 | return n; |
| 534 | } |
| 535 | |
| 536 | // Gets previous sound from n that has actually been alloced |
| 537 | int GetPrevSound(int n) { |
no outgoing calls
no test coverage detected