Specify the next/prev item to be drawn in the box by DrawItem. Returns the item # following or preceding the passed the item #
| 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 # |
| 533 | int CGrTextureListBox::ListNextItem(int curtex) { |
| 534 | int next_texture = -1; |
| 535 | |
| 536 | if (curtex >= 0) |
| 537 | next_texture = GetNextTexture(curtex); |
| 538 | if (next_texture <= curtex) |
| 539 | return curtex; |
| 540 | |
| 541 | while ((Show_used && !CurrentlyUsedTextures[next_texture]) || |
| 542 | !(GameTextures[next_texture].flags & D3EditState.texture_display_flags)) { |
| 543 | next_texture = GetNextTexture(next_texture); |
| 544 | // mprintf(0, "next_tex = %d\n", next_texture); |
| 545 | if (next_texture == curtex) { |
| 546 | break; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | return next_texture; |
| 551 | } |
| 552 | |
| 553 | int CGrTextureListBox::ListPrevItem(int curtex) { |
| 554 | int prev_texture = -1; |
no test coverage detected