mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-09 21:16:25 -05:00
Put ticker class and pp_colors in hpp file in namespace and remove helper files (#2577)
This commit is contained in:
parent
d73db884f0
commit
4ecc9d04fe
5 changed files with 43 additions and 143 deletions
44
firmware/application/external/doom/ui_doom.hpp
vendored
44
firmware/application/external/doom/ui_doom.hpp
vendored
|
|
@ -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__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue