Specify the first item to be drawn in the box by DrawItem. returns the item # return -1 if there is no first item (list is empty, maybe)
| 510 | // Specify the first item to be drawn in the box by DrawItem. returns the item # |
| 511 | // return -1 if there is no first item (list is empty, maybe) |
| 512 | int CGrTextureListBox::ListFirstItem(int firsttex) { |
| 513 | // skip the error texture |
| 514 | if (firsttex < 0) |
| 515 | firsttex = 0; |
| 516 | if (firsttex == 0) |
| 517 | firsttex++; |
| 518 | |
| 519 | // find first texture that is used if the texture passed became invalid. |
| 520 | if (!GameTextures[firsttex].used || !(GameTextures[firsttex].flags & D3EditState.texture_display_flags) || |
| 521 | (Show_used && !CurrentlyUsedTextures[firsttex])) { |
| 522 | int new_first = ListNextItem(firsttex); |
| 523 | if (new_first == firsttex) |
| 524 | return -1; |
| 525 | else |
| 526 | return new_first; |
| 527 | } else |
| 528 | return firsttex; |
| 529 | } |
| 530 | |
| 531 | // Specify the next/prev item to be drawn in the box by DrawItem. |
| 532 | // Returns the item # following or preceding the passed the item # |