Sets the status of a glow light
| 416 | } |
| 417 | // Sets the status of a glow light |
| 418 | void SetGlowStatus(int roomnum, int facenum, vector *center, float size, int fast) { |
| 419 | int i; |
| 420 | int first = 1; |
| 421 | int first_free = -1; |
| 422 | int done = 0; |
| 423 | int count = 0; |
| 424 | int found = 0; |
| 425 | for (i = 0; i < MAX_LIGHT_GLOWS && !done; i++) { |
| 426 | if (count >= Num_glows) { |
| 427 | if (first_free == -1) |
| 428 | first_free = i; |
| 429 | done = 1; |
| 430 | continue; |
| 431 | } |
| 432 | if (LightGlows[i].flags & LGF_USED) { |
| 433 | count++; |
| 434 | if (LightGlows[i].roomnum == roomnum && LightGlows[i].facenum == facenum) { |
| 435 | found = 1; |
| 436 | LightGlows[i].flags |= LGF_INCREASING; |
| 437 | done = 1; |
| 438 | } |
| 439 | } else { |
| 440 | if (first) { |
| 441 | first_free = i; |
| 442 | first = 0; |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | if (!found) // couldn't find it - is it a new one? |
| 447 | { |
| 448 | if (first_free == -1) // no free slots |
| 449 | return; |
| 450 | LightGlows[first_free].flags = LGF_USED | LGF_INCREASING; |
| 451 | if (fast) |
| 452 | LightGlows[first_free].flags |= LGF_FAST; |
| 453 | LightGlows[first_free].roomnum = roomnum; |
| 454 | LightGlows[first_free].facenum = facenum; |
| 455 | LightGlows[first_free].scalar = 0; |
| 456 | LightGlows[first_free].size = size; |
| 457 | LightGlows[first_free].center = *center; |
| 458 | Num_glows++; |
| 459 | } |
| 460 | } |
| 461 | // Takes a min,max vector and makes a surrounding cube from it |
| 462 | void MakePointsFromMinMax(vector *corners, vector *minp, vector *maxp) { |
| 463 | corners[0].x = minp->x; |
no outgoing calls
no test coverage detected