Put ticker class and pp_colors in hpp file in namespace and remove helper files (#2577)

This commit is contained in:
RocketGod 2025-03-20 00:08:21 -07:00 committed by GitHub
parent d73db884f0
commit 4ecc9d04fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 143 deletions

View file

@ -14,6 +14,49 @@
#include "message.hpp"
namespace ui::external_app::doom {
using Callback = void (*)();
class Ticker {
public:
Ticker() {}
void attach(Callback func, double delay_sec) {
game_update_callback = func;
game_update_timeout = delay_sec * 60;
}
void detach() {
game_update_callback = nullptr;
}
private:
Callback game_update_callback = nullptr;
uint32_t game_update_timeout = 0;
};
extern ui::Painter painter;
enum {
White,
Blue,
Yellow,
Purple,
Green,
Red,
Maroon,
Orange,
Black,
};
static const Color pp_colors[] = {
Color::white(),
Color::blue(),
Color::yellow(),
Color::purple(),
Color::green(),
Color::red(),
Color::magenta(),
Color::orange(),
Color::black(),
};
class DoomView : public View {
public:
@ -36,7 +79,6 @@ class DoomView : public View {
this->frame_sync();
}};
};
} // namespace ui::external_app::doom
#endif /*__UI_DOOM_H__*/