Panel now holds data on how it should be rendered and render just uses that instead of calculating it.

This commit is contained in:
Zed A. Shaw 2024-11-18 12:07:44 -05:00
parent 1a3bbaedda
commit f79e7638c0
5 changed files with 27 additions and 17 deletions

View file

@ -23,7 +23,6 @@ const int BASE_MAP_FONT_SIZE=90;
const wchar_t BG_TILE = L'';
const wchar_t UI_BASE_CHAR = L'';
const int BG_BOX_OFFSET=5;
const int UI_PANEL_BORDER_PX=5;
enum class Value {
BLACK=0, DARK_DARK, DARK_MID,
@ -59,7 +58,7 @@ struct SFMLRender {
bool resize_map(int new_size, Point &view_port);
void render_grid(const std::wstring &text, float x, float y);
void render_text(const std::wstring &text, float x, float y);
void draw_text(Panel &panel, bool with_border=false);
void draw_text(Panel &panel);
void draw_grid(Panel &panel, float map_off_x=0.0f, float map_off_y=0.0f);
bool poll_event(sf::Event &event) {