* Caller of Menu_Loop is responsible for cleaning up button states */
| 9647 | * Caller of Menu_Loop is responsible for cleaning up button states |
| 9648 | */ |
| 9649 | void cFodder::Menu_Loop(const std::function<void()> pButtonHandler) { |
| 9650 | |
| 9651 | Menu_Button_Reset(); |
| 9652 | |
| 9653 | mSurface->Save(); |
| 9654 | mGraphics->PaletteSet(); |
| 9655 | mSurface->palette_FadeTowardNew(); |
| 9656 | |
| 9657 | mInterruptCallback = [this]() { |
| 9658 | |
| 9659 | Mouse_DrawCursor(); |
| 9660 | }; |
| 9661 | |
| 9662 | for (;;) { |
| 9663 | |
| 9664 | Video_Sleep(); |
| 9665 | |
| 9666 | if (Menu_Draw(pButtonHandler)) |
| 9667 | break; |
| 9668 | } |
| 9669 | |
| 9670 | mInterruptCallback = nullptr; |
| 9671 | Image_FadeOut(); |
| 9672 | mSurface->clearBuffer(); |
| 9673 | } |
| 9674 | |
| 9675 | bool cFodder::Menu_Draw(const std::function<void()> pButtonHandler) { |
| 9676 |
nothing calls this directly
no test coverage detected