d976595879
Main / Build (BookPlayer) (push) Has been cancelled
Main / Build (Brainfuck) (push) Has been cancelled
Main / Build (Breakout) (push) Has been cancelled
Main / Build (Calculator) (push) Has been cancelled
Main / Build (Diceware) (push) Has been cancelled
Main / Build (EpubReader) (push) Has been cancelled
Main / Build (GPIO) (push) Has been cancelled
Main / Build (GraphicsDemo) (push) Has been cancelled
Main / Build (HelloWorld) (push) Has been cancelled
Main / Build (M5UnitTest) (push) Has been cancelled
Main / Build (Magic8Ball) (push) Has been cancelled
Main / Build (MediaKeys) (push) Has been cancelled
Main / Build (MystifyDemo) (push) Has been cancelled
Main / Build (SerialConsole) (push) Has been cancelled
Main / Build (Snake) (push) Has been cancelled
Main / Build (TamaTac) (push) Has been cancelled
Main / Build (TodoList) (push) Has been cancelled
Main / Build (TwoEleven) (push) Has been cancelled
Main / Bundle (push) Has been cancelled
29 lines
708 B
C++
29 lines
708 B
C++
#pragma once
|
|
|
|
#include "DungeonModel.h"
|
|
#include <GameKit.h>
|
|
#include <lvgl.h>
|
|
|
|
namespace PocketDungeon {
|
|
|
|
class DungeonRenderer {
|
|
lv_obj_t* root = nullptr;
|
|
lv_obj_t* board = nullptr;
|
|
lv_obj_t* cells[DUNGEON_ROWS][DUNGEON_COLS] {};
|
|
lv_obj_t* labels[DUNGEON_ROWS][DUNGEON_COLS] {};
|
|
lv_obj_t* status = nullptr;
|
|
lv_obj_t* message = nullptr;
|
|
GameKit::GridSpec grid {};
|
|
|
|
static lv_color_t tileColor(Tile tile);
|
|
static const char* tileText(Tile tile);
|
|
static lv_color_t entityColor(EntityType type);
|
|
void clearEntityLabels();
|
|
|
|
public:
|
|
void create(lv_obj_t* parent);
|
|
void render(const DungeonModel& model, MoveResult lastResult);
|
|
};
|
|
|
|
} // namespace PocketDungeon
|